[Haskell-cafe] Explicitly passing an argument to an arrow
Alfredo Di Napoli
alfredo.dinapoli at gmail.com
Wed Oct 3 10:41:25 CEST 2012
sorry for the dumb question but I'm wrapping my head around arrow just from
Consider this toy function to swap argument of a tuple:
swapA' :: (Arrow a) => a ((b,c), (b,c)) (c,b)
swapA' = swapFirst >>> swapSecond
swapFirst = first $ arr snd
swapSecond = second $ arr fst
It works but requires to pass a tuple of tuple, namely ((b,c), (b,c)).
How can I explicitly pass my tuple of tuple to swapFirst so I can simply
and get the correct result?
ps. I know that swap can be easily and elegantly be written as:
swap = snd &&& fst
but the point of the exercise was to experiment with first, second and
Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe