Proposal: add fromRight and fromLeft to Data.Either

Evan Laforge qdunkan at gmail.com
Fri May 20 20:17:20 UTC 2016


I wouldn't want to encourage partial functions without even an error
message.  Usually with Either you'll want to use the unexpected value in
the error msg, e.g 'either (error . ("xyz: "++) . show) id'.

On Fri, May 20, 2016 at 1:08 PM, Anton Felix Lorenzen <anfelor at posteo.de>
wrote:

> When working with Either,
> I am often missing two simple functions:
> fromRight :: Either a b -> b
> fromLeft  :: Either a b -> a
>
> It has been implemented a couple of times:
> http://hayoo.fh-wedel.de/?query=fromRight
>
> But I don't want to depend on yet another library
> for such a basic function.
>
> Could it be added?
>
> Anton
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160520/ed5d219d/attachment.html>


More information about the Libraries mailing list