[Haskell-cafe] Why Maybe exists if there is Either?
allbery.b at gmail.com
Thu Jan 9 17:16:08 UTC 2014
On Thu, Jan 9, 2014 at 12:11 PM, Ben Foppa <benjamin.foppa at gmail.com> wrote:
> Aside from the point made about typeclass instances, I don't see an issue
> type Maybe = Either ()
> nothing :: Maybe a
> nothing = Left ()
> just :: a -> Maybe a
> just = Right
Not until you try to pattern match on it....
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe