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

2012-10-03 Thread Alfredo Di Napoli
Hello everyone, sorry for the dumb question but I'm wrapping my head around arrow just from this morning. Consider this toy function to swap argument of a tuple: swapA' :: (Arrow a) = a ((b,c), (b,c)) (c,b) swapA' = swapFirst swapSecond where swapFirst = first $ arr snd swapSecond =

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

2012-10-03 Thread Brent Yorgey
On Wed, Oct 03, 2012 at 10:41:25AM +0200, Alfredo Di Napoli wrote: Hello everyone, sorry for the dumb question but I'm wrapping my head around arrow just from this morning. Consider this toy function to swap argument of a tuple: swapA' :: (Arrow a) = a ((b,c), (b,c)) (c,b) swapA' =

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

2012-10-03 Thread Alfredo Di Napoli
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 terms: swapA' :: (Arrow a) = a ((b,c), (b,c)) (c,b) swapA' t = () swapFirst swapSecond (???) where swapFirst =

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

2012-10-03 Thread Ertugrul Söylemez
Alfredo Di Napoli alfredo.dinap...@gmail.com wrote: 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 terms: swapA' :: (Arrow a) = a ((b,c), (b,c)) (c,b) swapA' t =

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

2012-10-03 Thread Alfredo Di Napoli
I see. There exists an equivalent version but more generic? Just out of curiosity, I'm still pretty new to arrows, as you may have read :) Thanks, A. On 3 October 2012 15:59, Ertugrul Söylemez e...@ertes.de wrote: Alfredo Di Napoli alfredo.dinap...@gmail.com wrote: Solution was simple,