Proposal: Add isLeft/isRight to Data.Either

Herbert Valerio Riedel hvr at gnu.org
Thu Dec 6 12:55:49 CET 2012


Herbert Valerio Riedel <hvr at gnu.org> writes:

[...]

>    and also their dual (see fromRight' above) is defined there:

sorry, I was mixed something up; ignore that "(see fromRight' above)" comment

the dual to 'maybeRight' is rather something like:

maybeToRight :: a -> Maybe b -> Either a b
maybeToRight l = maybe (Left l) Right

>     - precis:Precis.Utils.ControlOperators.elaborate
>     - errors:Control.Error.Util.note


>  - from{Left,Right} are useful when working in the 'Maybe' monad or

s/from/maybe/





More information about the Libraries mailing list