[Haskell-cafe] Maybe to Either -- is there a better way?

Yitzchak Gale gale at sefer.org
Tue Aug 3 05:19:06 EDT 2010


Tom Davies wrote:
>> I find it convenient sometimes to convert a Maybe
>> value to an Either

maybeToEither = flip maybe Right . Left

Christopher Done wrote:
> It's available in MissingH

While useful, I think its ubiquity to simplicity ratio is not
high enough to justify either depending on MissingH
just for that, or adding it to a base library.

However, if your personal style makes this so
ubiquitous as to override its simplicity, go ahead
and upload it to Hackage, perhaps others will
also benefit.

Regards,
Yitz


More information about the Haskell-Cafe mailing list