[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!
> swapA' = dup >>> swapFirst >>> swapSecond
> 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!
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe