git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
build docs
125b023JP Smith
prelude/README.md+36
@@ -25,6 +25,11 @@ flip :: forall a b c. (a -> b -> c) -> b -> a -> c
25
25
26Flips the order of the arguments to a function of two arguments.
26Flips the order of the arguments to a function of two arguments.
27
27
28+E.g.
29+
30+ flip const 1 2 = const 2 1 = 2
31+
32+
28#### `const`
33#### `const`
29
34
30``` purescript
35``` purescript
@@ -33,6 +38,11 @@ const :: forall a b. a -> b -> a
33
38
34Returns its first argument and ignores its second.
39Returns its first argument and ignores its second.
35
40
41+E.g.
42+
43+ const 1 2 = 1
44+
45+
36#### `asTypeOf`
46#### `asTypeOf`
37
47
38``` purescript
48``` purescript
@@ -111,6 +121,16 @@ instance categoryArr :: Category Prim.Function
111($) :: forall a b. (a -> b) -> a -> b
121($) :: forall a b. (a -> b) -> a -> b
112```
122```
113
123
124+Applies a function to its argument
125+
126+E.g.
127+
128+ const $ 1 2 = const 1 2 = 1
129+
130+`($)` is different from [`(#)`](#-2) because it is right-infix instance instead of left.
131+Right-infix operators parse like (a $ (b $ (c $ (d ...)))) whereas left-infix operators parse
132+like (((a # b) # c) # d ...).
133+
114
134
115#### `(#)`
135#### `(#)`
116
136
@@ -118,6 +138,16 @@ instance categoryArr :: Category Prim.Function
118(#) :: forall a b. a -> (a -> b) -> b
138(#) :: forall a b. a -> (a -> b) -> b
119```
139```
120
140
141+Applies a function to its argument
142+
143+E.g.
144+
145+ 3 # ((+) 1) = 3 + 1 = 4
146+
147+`(#)` is different from [`($)`](#-1) because it is left-infix instance instead of right.
148+Right-infix operators parse like (a $ (b $ (c $ (d ...)))) whereas left-infix operators parse
149+like (((a # b) # c) # d ...).
150+
121
151
122#### `(:)`
152#### `(:)`
123
153
@@ -125,6 +155,12 @@ instance categoryArr :: Category Prim.Function
125(:) :: forall a. a -> [a] -> [a]
155(:) :: forall a. a -> [a] -> [a]
126```
156```
127
157
158+Attaches an element to the front of a list.
159+
160+E.g.
161+
162+ 1 : [2, 3, 4] = [1, 2, 3, 4]
163+
128
164
129#### `cons`
165#### `cons`
130
166