Proposal: add fromRight and fromLeft to Data.Either

Twan van Laarhoven twanvl at gmail.com
Tue May 24 12:28:59 UTC 2016


+1 from me.

I often use such functions when working in GHCi, and it is consistent with the 
existence of fromJust. That said, I understand the opposition, and these 
functions should never be used in production code.

Maybe we should put the lot of them (together with head, tail, fromJust) into a 
"Partial" module?

Twan

On 2016-05-20 22:08, Anton Felix Lorenzen 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


More information about the Libraries mailing list