Add instance Alternative (f :+: g)

Dannyu NDos ndospark320 at gmail.com
Tue Aug 6 19:44:33 UTC 2019


instance Alternative f => Alternative (f :+: g) where
    empty = InL empty
    InL x <|> InL y = InL (x <|> y)
    InL _ <|> y = y
    x <|> _ = x

This is analogous to the proposed Alternative Either instance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190807/2749cf0d/attachment.html>


More information about the Libraries mailing list