@@ -31,6 +31,14 @@ For example, the `Array` (`[]`) type is an instance of `Alt`, where
3131class (Applicative f, Plus f) <= Alternative f where
3232```
3333
34+ The ` Alternative ` type class has no members of its own; it just specifies
35+ that the type has both ` Applicative ` and ` Plus ` instances.
36+
37+ Types which have ` Alternative ` instances should also satisfy the following
38+ laws:
39+
40+ - Distributivity: ` (f <|> g) <*> x == (f <*> x) <|> (g <*> x) `
41+ - Annihilation: ` empty <*> f = empty `
3442
3543#### ` some `
3644
@@ -298,13 +306,14 @@ unless :: forall m. (Monad m) => Boolean -> m Unit -> m Unit
298306class (Monad m, Alternative m) <= MonadPlus m where
299307```
300308
301- The ` MonadPlus ` type class has none of its own functions ; it just
302- specifies that the type has both ` Monad ` and ` Alternative ` instances.
309+ The ` MonadPlus ` type class has no members of its own; it just specifies
310+ that the type has both ` Monad ` and ` Alternative ` instances.
303311
304312Types which have ` MonadPlus ` instances should also satisfy the following
305- law :
313+ laws :
306314
307- - Left distributivity: ` (x <|> y) >>= f == (x >>= f) <|> (y >>= f) `
315+ - Distributivity: ` (x <|> y) >>= f == (x >>= f) <|> (y >>= f) `
316+ - Annihilation: ` empty >>= f = empty `
308317
309318#### ` guard `
310319
@@ -333,4 +342,4 @@ kind `* -> *`, like `Array` or `List`, rather than concrete types like
333342
334343- Left identity: ` empty <|> x == x `
335344- Right identity: ` x <|> empty == x `
336- - ??? : ` f <$> empty == empty `
345+ - Annihilation : ` f <$> empty == empty `
0 commit comments