Re: [Haskell-cafe] Mapping a list of functions

2010-06-20 Thread Liam O'Connor
swing map :: forall a b. [a - b] - a - [b] swing any :: forall a. [a - Bool] - a - Bool swing foldr :: forall a b. b - a - [a - b - b] - b swing zipWith :: forall a b c. [a - b - c] - a - [b] - [c] swing find :: forall a. [a - Bool] - a - Maybe (a - Bool) -- applies each of the predicates to

Re: [Haskell-cafe] Mapping a list of functions

2010-06-20 Thread Christopher Done
I love that. It's great. Definitely going in my .ghci file. On 20 June 2010 12:28, Liam O'Connor lia...@cse.unsw.edu.au wrote: swing map :: forall a b. [a - b] - a - [b] swing any :: forall a. [a - Bool] - a - Bool swing foldr :: forall a b. b - a - [a - b - b] - b swing zipWith :: forall a b

Re: [Haskell-cafe] Mapping a list of functions

2010-06-19 Thread Limestraƫl
??? What does exactly swing do ? 2010/6/18 Bulat Ziganshin bulat.zigans...@gmail.com Hello Martin, Thursday, June 17, 2010, 11:02:31 PM, you wrote: But what if I want to apply a list of functions to a single argument. I can one more answer is swing map:

[Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Martin Drautzburg
Hello all The standard map function applies a single function to a list of arguments. But what if I want to apply a list of functions to a single argument. I can of course write such a function, but I wonder if there is a standard way of doing this, Related to that is the problem, that the

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Alexander Solla
On Jun 17, 2010, at 12:02 PM, Martin Drautzburg wrote: The standard map function applies a single function to a list of arguments. But what if I want to apply a list of functions to a single argument. I can of course write such a function, but I wonder if there is a standard way of doing

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Don Stewart
Martin.Drautzburg: Hello all The standard map function applies a single function to a list of arguments. But what if I want to apply a list of functions to a single argument. I can of course write such a function, but I wonder if there is a standard way of doing this, map ($ 2)

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Andrew Coppin
Martin Drautzburg wrote: Hello all The standard map function applies a single function to a list of arguments. But what if I want to apply a list of functions to a single argument. I can of course write such a function, but I wonder if there is a standard way of doing this, The magical

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Tillmann Rendel
Martin Drautzburg wrote: The standard map function applies a single function to a list of arguments. But what if I want to apply a list of functions to a single argument. So your list of arguments is actually a list of functions. But since functions are first-class values, that shouldn't be

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Miguel Mitrofanov
listFs = [f1, f2, f3] map ($ x) listFs -- same as [f1 x, f2 x, f3 x] f x y z = ... map (\x - f x u v) xs On 17 Jun 2010, at 23:02, Martin Drautzburg wrote: Hello all The standard map function applies a single function to a list of arguments. But what if I want to apply a list of functions

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Gregory Collins
Martin Drautzburg martin.drautzb...@web.de writes: Hello all The standard map function applies a single function to a list of arguments. But what if I want to apply a list of functions to a single argument. I can of course write such a function, but I wonder if there is a standard way of

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Roman Beslik
map (\function - function argument) functions map ($ argument) functions map (\firstArgument - function firstArgument secondArgument thirdArgument) xs On 17.06.10 22:02, Martin Drautzburg wrote: Hello all The standard map function applies a single function to a list of arguments. But what

Re: [Haskell-cafe] Mapping a list of functions

2010-06-17 Thread Bulat Ziganshin
Hello Martin, Thursday, June 17, 2010, 11:02:31 PM, you wrote: But what if I want to apply a list of functions to a single argument. I can one more answer is swing map: http://www.haskell.org/haskellwiki/Pointfree#Swing -- Best regards, Bulat