@@ -31,27 +31,28 @@ module Prelude
3131
3232 -- | An alias for `true`, which can be useful in guard clauses:
3333 -- |
34− -- | E.g.
35− -- |
34+ -- | ```purescript
3635 -- | max x y | x >= y = x
3736 -- | | otherwise = y
37+ -- | ```
38+ -- |
3839 otherwise :: Boolean
3940 otherwise = true
4041
4142 -- | Flips the order of the arguments to a function of two arguments.
4243 -- |
43− -- | E.g.
44− -- |
44+ -- | ```purescript
4545 -- | flip const 1 2 = const 2 1 = 2
46+ -- | ```
4647 -- |
4748 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
4849 flip f b a = f a b
4950
5051 -- | Returns its first argument and ignores its second.
5152 -- |
52− -- | E.g.
53− -- |
54− -- | const 1 2 = 1
53+ -- | ```purescript
54+ -- | const 1 "hello" = 1
55+ -- | ```
5556 -- |
5657 const :: forall a b. a -> b -> a
5758 const a _ = a
@@ -59,9 +60,9 @@ module Prelude
5960 -- | This function returns its first argument, and can be used to assert type equalities.
6061 -- | This can be useful when types are otherwise ambiguous.
6162 -- |
62− -- | E.g.
63− -- |
63+ -- | ```purescript
6464 -- | main = print $ [] `asTypeOf` [0]
65+ -- | ```
6566 -- |
6667 -- | If instead, we had written `main = print []`, the type of the argument `[]` would have
6768 -- | been ambiguous, resulting in a compile-time error.
@@ -110,26 +111,26 @@ module Prelude
110111
111112 -- | Applies a function to its argument
112113 -- |
113− -- | E.g.
114− -- |
115− -- | const $ 1 2 = const 1 2 = 1
114+ -- | ```purescript
115+ -- | (+) 1 ((*) 2 (const 1 2)) = (+) 1 $ (*) 2 $ const 1 2
116+ -- | ```
116117 -- |
117− -- | `($)` is different from [`(#)`](#-2) because it is right-infix instance instead of left.
118− -- | Right-infix operators parse like (a $ (b $ (c $ (d ...)))) whereas left-infix operators parse
119− -- | like (((a # b) # c) # d ...).
118+ -- | `($)` is different from [`(#)`](#-2) because it is right-infix instead of left. Right-infix
119+ -- | operators parse like (a $ (b $ (c $ (d ...)))) whereas left-infix operators parse like
120+ -- | `(((a # b) # c) # d ...)`.
120121 -- |
121122 ($) :: forall a b. (a -> b) -> a -> b
122123 ($) f x = f x
123124
124125 -- | Applies a function to its argument
125126 -- |
126− -- | E.g.
127+ -- | ```purescript
128+ -- | (((3 + 1) * 2) + 4) = 3 # ((+) 1) # ((*) 2) # ((+) 4)
129+ -- | ```
127130 -- |
128− -- | 3 # ((+) 1) = 3 + 1 = 4
129− -- |
130− -- | `(#)` is different from [`($)`](#-1) because it is left-infix instance instead of right.
131− -- | Right-infix operators parse like (a $ (b $ (c $ (d ...)))) whereas left-infix operators parse
132− -- | like (((a # b) # c) # d ...).
131+ -- | `(#)` is different from [`($)`](#-1) because it is left-infix instead of right. Right-infix
132+ -- | operators parse like (a $ (b $ (c $ (d ...)))) whereas left-infix operators parse like
133+ -- | `(((a # b) # c) # d ...)`.
133134 -- |
134135 (#) :: forall a b. a -> (a -> b) -> b
135136 (#) x f = f x
@@ -138,9 +139,9 @@ module Prelude
138139
139140 -- | Attaches an element to the front of a list.
140141 -- |
141− -- | E.g.
142− -- |
142+ -- | ```purescript
143143 -- | 1 : [2, 3, 4] = [1, 2, 3, 4]
144+ -- | ```
144145 -- |
145146 (:) :: forall a. a -> [a] -> [a]
146147 (:) = cons