git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
generally edited and revised
6b4c631JP Smith
prelude/prelude.purs+20−26
@@ -61,10 +61,10 @@ module Prelude
61 infixr 9 >>>
61 infixr 9 >>>
62 infixr 9 <<<
62 infixr 9 <<<
63
63
64− -- | Semigroupoids are Categories, less `id`, which is to say they consist of objects and
64+ -- | A `Semigroupoid` is similar to a [`Category`](#Category) but does not require an identity
65− -- | morphisms between them which can be composed.
65+ -- | element `id`, just composable morphisms.
66 -- |
66 -- |
67− -- | Semigroupoids should obey the following rule:
67+ -- | `Semigroupoid`s should obey the following rule:
68 -- |
68 -- |
69 -- | Association
69 -- | Association
70 -- | forall p q r. p <<< (q <<< r) = (p <<< q) <<< r
70 -- | forall p q r. p <<< (q <<< r) = (p <<< q) <<< r
@@ -78,13 +78,10 @@ module Prelude
78 (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
78 (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
79 (>>>) f g = g <<< f
79 (>>>) f g = g <<< f
80
80
81− -- | Categories consist of objects and composable morphisms between them, and as such are
81+ -- | `Category`s consist of objects and composable morphisms between them, and as such are
82− -- | semigroupoids, but unlike semigroupoids must have an identity element.
82+ -- | [`Semigroupoids`](#Semigroupoid), but unlike `semigroupoids` must have an identity element.
83 -- |
83 -- |
84− -- | Categories should obey the following rules.
84+ -- | `Category`s should obey the following rules.
85− -- |
86− -- | Association (as semigroupoids)
87− -- | forall p q r. p <<< (q <<< r) = (p <<< q) <<< r
88 -- |
85 -- |
89 -- | Left Identity
86 -- | Left Identity
90 -- | forall p. id <<< p = p
87 -- | forall p. id <<< p = p
@@ -170,10 +167,10 @@ module Prelude
170 infixl 4 <$>
167 infixl 4 <$>
171 infixl 1 <#>
168 infixl 1 <#>
172
169
173− -- | A Functor is intuitively a type which can be mapped over, and more formally a mapping
170+ -- | A `Functor` is intuitively a type which can be mapped over, and more formally a mapping
174− -- | between categories that preserves structure.
171+ -- | between [`Category`](#Category)s that preserves structure.
175 -- |
172 -- |
176− -- | Functors should obey the following rules.
173+ -- | `Functor`s should obey the following rules.
177 -- |
174 -- |
178 -- | Identity
175 -- | Identity
179 -- | (<$>) id = id
176 -- | (<$>) id = id
@@ -192,10 +189,10 @@ module Prelude
192
189
193 infixl 4 <*>
190 infixl 4 <*>
194
191
195− -- | Applys are intuitively Applicatives less `pure`, and more formally a strong lax semi-
192+ -- | `Apply`s are intuitively [`Applicative`](#Applicative)s less `pure`, and more formally a
196− -- | -monoidal endofunctor.
193+ -- | strong lax semi-monoidal endofunctor.
197 -- |
194 -- |
198− -- | Applys should obey the following rules.
195+ -- | `Apply`s should obey the following rules.
199 -- |
196 -- |
200 -- | Associative Composition
197 -- | Associative Composition
201 -- | forall f g h. (.) <$> f <*> g <*> h = f <*> (g <*> h)
198 -- | forall f g h. (.) <$> f <*> g <*> h = f <*> (g <*> h)
@@ -203,10 +200,10 @@ module Prelude
203 class (Functor f) <= Apply f where
200 class (Functor f) <= Apply f where
204 (<*>) :: forall a b. f (a -> b) -> f a -> f b
201 (<*>) :: forall a b. f (a -> b) -> f a -> f b
205
202
206− -- | Applicatives are Functors which can be "applied" by sequencing composition (<*>) or embedding
203+ -- | `Applicative`s are [`Functor`](#Functor)s which can be "applied" by sequencing composition
207− -- | pure expressions (pure).
204+ -- | (`<*>`) or embedding pure expressions (`pure`).
208 -- |
205 -- |
209− -- | Applicatives should obey the following rules.
206+ -- | `Applicative`s should obey the following rules.
210 -- |
207 -- |
211 -- | Identity
208 -- | Identity
212 -- | forall v. (pure id) <*> v = v
209 -- | forall v. (pure id) <*> v = v
@@ -228,23 +225,20 @@ module Prelude
228
225
229 infixl 1 >>=
226 infixl 1 >>=
230
227
231− -- | A Bind is an Apply with a bind operation which sequentially composes actions.
228+ -- | A `Bind` is an [`Apply`](#Apply) with a bind operation which sequentially composes actions.
232 -- |
229 -- |
233− -- | A Bind should obey the following rule.
230+ -- | `Bind`s should obey the following rule.
234 -- |
231 -- |
235− -- | Associative (as Bind)
232+ -- | Associativity
236 -- | forall f g x. (x >>= f) >>= g = x >>= (\k => f k >>= g)
233 -- | forall f g x. (x >>= f) >>= g = x >>= (\k => f k >>= g)
237 -- |
234 -- |
238 class (Apply m) <= Bind m where
235 class (Apply m) <= Bind m where
239 (>>=) :: forall a b. m a -> (a -> m b) -> m b
236 (>>=) :: forall a b. m a -> (a -> m b) -> m b
240
237
241− -- | Monad is a class which can be intuitively thought of as an abstract datatype of actions or
238+ -- | `Monad` is a class which can be intuitively thought of as an abstract datatype of actions or
242 -- | more formally though of as a monoid in the category of endofunctors.
239 -- | more formally though of as a monoid in the category of endofunctors.
243 -- |
240 -- |
244− -- | A Monad should obey the following rules.
241+ -- | `Monad`s should obey the following rules.
245− -- |
246− -- | Associative (as Bind)
247− -- | forall f g x. (x >>= f) >>= g = x >>= (\k => f k >>= g)
248 -- |
242 -- |
249 -- | Left Identity
243 -- | Left Identity
250 -- | forall f x. pure x >>= f = f x
244 -- | forall f x. pure x >>= f = f x