@@ -12,10 +12,11 @@ otherwise :: Boolean
13An alias for `true`, which can be useful in guard clauses:
13An alias for `true`, which can be useful in guard clauses:
20#### `flip`
21#### `flip`
@@ -25,6 +26,11 @@ flip :: forall a b c. (a -> b -> c) -> b -> a -> c
26Flips the order of the arguments to a function of two arguments.
27Flips the order of the arguments to a function of two arguments.
30+flip const 1 2 = const 2 1 = 2
28#### `const`
34#### `const`
30``` purescript
36``` purescript
@@ -33,6 +39,11 @@ const :: forall a b. a -> b -> a
34Returns its first argument and ignores its second.
40Returns its first argument and ignores its second.
36#### `asTypeOf`
47#### `asTypeOf`
38``` purescript
49``` purescript
@@ -42,9 +53,9 @@ asTypeOf :: forall a. a -> a -> a
42This function returns its first argument, and can be used to assert type equalities.
53This function returns its first argument, and can be used to assert type equalities.
43This can be useful when types are otherwise ambiguous.
54This can be useful when types are otherwise ambiguous.
47− main = print $ [] `asTypeOf` [0]
57+main = print $ [] `asTypeOf` [0]
49If instead, we had written `main = print []`, the type of the argument `[]` would have
60If instead, we had written `main = print []`, the type of the argument `[]` would have
50been ambiguous, resulting in a compile-time error.
61been ambiguous, resulting in a compile-time error.
@@ -111,6 +122,21 @@ instance categoryArr :: Category Prim.Function
111($) :: forall a b. (a -> b) -> a -> b
122($) :: forall a b. (a -> b) -> a -> b
125+Applies a function to its argument
128+length $ groupBy productCategory $ filter isInStock products
134+length (groupBy productCategory (filter isInStock (products)))
137+`($)` is different from [`(#)`](#-2) because it is right-infix instead of left, so
138+`a $ b $ c $ d x` = `a (b (c (d x)))`
115#### `(#)`
141#### `(#)`
@@ -118,6 +144,21 @@ instance categoryArr :: Category Prim.Function
118(#) :: forall a b. a -> (a -> b) -> b
144(#) :: forall a b. a -> (a -> b) -> b
147+Applies a function to its argument
150+products # groupBy productCategory # filter isInStock # length
156+length (groupBy productCategory (filter isInStock (products)))
159+`(#)` is different from [`($)`](#-1) because it is left-infix instead of right, so
160+`x # a # b # c # d` = `(((x a) b) c) d`
122#### `(:)`
163#### `(:)`
@@ -125,6 +166,12 @@ instance categoryArr :: Category Prim.Function
125(:) :: forall a. a -> [a] -> [a]
166(:) :: forall a. a -> [a] -> [a]
169+Attaches an element to the front of a list.
172+1 : [2, 3, 4] = [1, 2, 3, 4]
129#### `cons`
176#### `cons`