Adding dup to Data.Tuple?

Edward Kmett ekmett at gmail.com
Sun Oct 28 22:10:26 UTC 2018


If we're going to add this we should add the symmetric operation for

jam :: Either a a -> a

to Data.Either. (Name taken from Conal's compiling to categories code.)

My own code has called these diag and codiag respectively. I happily yield
to a nicer convention.

I have no real preference for whether we do the simple version in
Data.Tuple (which has a lot of precedent, as Data.Tuple tends to have lots
of little simple combinators that could be done more generally as arrows)
or moving it into Control.Arrow.

-Edward

On Sun, Oct 28, 2018 at 12:07 PM Ivan Perez <ivan.perez at keera.co.uk> wrote:

> On 28/10/18 09:48, Vanessa McHale wrote:
> > According to GHCi,
> >
> > λ:> import Control.Arrow
> > λ:> :t (id &&& id)
> > (id &&& id) :: b -> (b, b)
> >
> > That is, this implementation has type a -> (a, a) as well.
> Yes, yes, that's what I meant by "it works for functions as well (since
> they are arrows)"
>
> Ivan
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20181028/afdb7c02/attachment.html>


More information about the Libraries mailing list