@@ -3,7 +3,7 @@ module Either where
3{-| Represents any data that can take two different types.
3{-| Represents any data that can take two different types.
5# Type and Constructors
5# Type and Constructors
6−@docs Either, Left, Right
6+@docs Either
8# Taking Eithers apart
8# Taking Eithers apart
9@docs either, isLeft, isRight
9@docs either, isLeft, isRight
@@ -15,9 +15,12 @@ module Either where
16import List
16import List
18+{-| Represents any data may take two forms. For example, a user ID may be
19+either an `Int` or a `String`.
18−{-| This can also be used for error handling `(Either String a)` where
21+This can also be used for error handling `(Either String a)` where
19− error messages are stored on the left, and the correct values
22+error messages are stored on the left, and the correct values
20− (“right” values) are stored on the right.
23+(“right” values) are stored on the right.
22data Either a b = Left a | Right b
25data Either a b = Left a | Right b