Diagonalization/ dupe for monads and tuples?
chessai1996 at gmail.com
Thu Sep 17 12:54:29 UTC 2020
My instinct about fromEither's type was the same as Carter's, and I had to
remind myself of fromMaybe. I like the name fromEither overall. Seems to
fit well with precedent and is straightforward enough.
On Thu, Sep 17, 2020, 07:45 Oliver Charles <ollie at ocharles.org.uk> wrote:
> You may wish to compare with fromMaybe then, which probably also doesn't
> have the type you'd expect :) The type you have there is more like bifoldMap
> On Thu, 17 Sep 2020, at 1:42 PM, Carter Schonwald wrote:
> I’d expect fromEither to be
> Either a b -> (a-> c )-> (b-> c) -> c
> Nothing about the name fromEither is suggestive of the Either a a type
> On Thu, Sep 17, 2020 at 3:45 AM Oliver Charles <ollie at ocharles.org.uk>
> Regardless of having a more abstract version, I'm +1 on Jon's suggestion,
> and those names. fromEither is something I have reached for many many times
> and been surprised it's not within arms reach.
> On Thu, 17 Sep 2020, at 7:16 AM, Jon Purdy wrote:
> I’m strongly for these:
> Data.Tuple.dup :: a → (a, a)
> Data.Either.fromEither :: Either a a → a
> Libraries mailing list
> Libraries at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries