@@ -14,9 +14,10 @@ It is similar to `Semigroup`, except that it applies to types of
1414kind ` * -> * ` , like ` Array ` or ` List ` , rather than concrete types like
1515` String ` or ` Number ` .
1616
17- ` Alt ` instances are required to satisfy the following law :
17+ ` Alt ` instances are required to satisfy the following laws :
1818
1919- Associativity: ` (x <|> y) <|> z == x <|> (y <|> z) `
20+ - Distribution: ` f <$> (x <|> y) == (f <$> x) <|> (f <$> y) `
2021
2122For example, the ` Array ` (` [] ` ) type is an instance of ` Alt ` , where
2223` (<|>) ` is defined to be concatenation.
@@ -318,10 +319,12 @@ class (Alt f) <= Plus f where
318319The ` Plus ` type class extends the ` Alt ` type class with a value that
319320should be the left and right identity for ` (<|>) ` .
320321It is similar to ` Monoid ` , except that it applies to types of
321- kind ( * -> * ) , like ` Array ` or ` List ` , rather than concrete types like
322+ kind ` * -> * ` , like ` Array ` or ` List ` , rather than concrete types like
322323` String ` or ` Number ` .
323324
324325` Plus ` instances should satisfy the following laws:
325326
326327- Left identity: ` empty <|> x == x `
327- - Right identity: ` x <|> empty == x `
328+ - Right identity: ` x <|> empty == x `
329+ - ???: ` f <$> empty == empty `
330+ - Left distribution: ` (x <|> y) >>= f == (x >>= f) <|> (y >>= f) `
0 commit comments