Diagonalization/ dupe for monads and tuples?

Philip Hazelden philip.hazelden at gmail.com
Thu Sep 17 17:13:35 UTC 2020


On Thu, Sep 17, 2020 at 5:59 PM Jon Purdy <evincarofautumn at gmail.com> wrote:

> { fromMaybe, fromLeft, fromRight, fromEither, fromThese, fromDynamic, … }
> extracts “the” value out of a { Maybe, These, Dynamic, … } with a suitable
> default if “it” isn’t present.
>

Hm. A weird thing about fromEither compared to (I think) all the rest of
these, is that the type of the Either isn't fully general. That is,
fromLeft and fromRight take an `Either a b`; fromThese takes a `These a b`.
But the proposed `fromEither` takes an `Either a a`.

This maybe isn't a big deal. Just seemed worth noting.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20200917/621a1e1d/attachment.html>


More information about the Libraries mailing list