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

Henning Thielemann schlepptop at henning-thielemann.de
Wed Aug 4 12:21:49 EDT 2010

Ivan Lazar Miljenovic schrieb:
> Yitzchak Gale <gale at sefer.org> writes:

>> 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.
> Just like the swap :: (a,b) -> (b,a) function a lot of people were
> discussing on libraries@?

I have 'swap' in my utility-ht.

> In general, I agree.

Problem in Haskell is, that it allows for a high degree of
modularization such that most components become trivial. Does that mean
that we should not define simple functions at all, which in the extreme
case would mean that we inline all potential function calls?

I think converting Maybe to Either is an often repeating task which
justifies an individual function. Maybe I add it to utility-ht.

More information about the Haskell-Cafe mailing list