[Haskell-cafe] Explicitly passing an argument to an arrow

Alfredo Di Napoli alfredo.dinapoli at gmail.com
Wed Oct 3 13:03:23 CEST 2012

Thanks Brent, this should do the trick, although what I was asking was
something more general:

For "explicitly pass" I meant passing them without the eta reduce, in other

swapA' :: (Arrow a) => a ((b,c), (b,c)) (c,b)
swapA'  t = (????) swapFirst >>> swapSecond (???)
    swapFirst  = first $ arr snd
    swapSecond = second $ arr fst

 where the question marks indicate that I don't know how to tell swapFirst
"hey, even though from the outside
I'm passing you a tuple *t*, you have to take as input a (t,t)."

Hope this is clearer or it has some sense at all, maybe I'm not getting
correctly the way arrows work!


Like this?
>   swapA' = dup >>> swapFirst >>> swapSecond
>     where
>       dup = id &&& id
>       ...
> I'm afraid I'm not confident I really understand your question,
> however, so if that doesn't answer it, try asking again!
> -Brent
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121003/e12a48b4/attachment.htm>

More information about the Haskell-Cafe mailing list