git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
build docs
commit125b023fe99a5c3a23658894ee8a3ec11d70f7f1 authorJP Smith <jp.smith@ilstu.edu> dateTue 24 Feb 2015, 10:10 (12 years ago) parent9569019
1 file changed+36
prelude/README.md+36
prelude/README.md+36
@@ -25,6 +25,11 @@ flip :: forall a b c. (a -> b -> c) -> b -> a -> c
2525
2626Flips the order of the arguments to a function of two arguments.
2727
28+E.g.
29+
30+ flip const 1 2 = const 2 1 = 2
31+
32+
2833#### `const`
2934
3035``` purescript
@@ -33,6 +38,11 @@ const :: forall a b. a -> b -> a
3338
3439Returns its first argument and ignores its second.
3540
41+E.g.
42+
43+ const 1 2 = 1
44+
45+
3646#### `asTypeOf`
3747
3848``` purescript
@@ -111,6 +121,16 @@ instance categoryArr :: Category Prim.Function
111121($) :: forall a b. (a -> b) -> a -> b
112122```
113123
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+
114134
115135#### `(#)`
116136
@@ -118,6 +138,16 @@ instance categoryArr :: Category Prim.Function
118138(#) :: forall a b. a -> (a -> b) -> b
119139```
120140
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+
121151
122152#### `(:)`
123153
@@ -125,6 +155,12 @@ instance categoryArr :: Category Prim.Function
125155(:) :: forall a. a -> [a] -> [a]
126156```
127157
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+
128164
129165#### `cons`
130166