On 20/02/07, David Roundy <[EMAIL PROTECTED]> wrote:
It's rather a small function to bother putting in the libraries, and I
think better expressed using map directly:
rmap fs x = map ($ x) fs
Yes. Now that I know the idiom, there's clearly little point in having
a named function for it.
Thank
On Tue, Feb 20, 2007 at 02:07:08PM +, Paul Moore wrote:
> I'm after a function, sort of equivalent to map, but rather than
> mapping a function over a list of arguments, I want to map a list of
> functions over the same argument. The signature would be [a -> b] -> a
> -> [b], but hoogle didn't
Quoth Paul Moore, nevermore,
> >Prelude> map ($ 3) [(*2),(+1),div 1]
> >[6,4,0]
>
> Cool. I told you I was missing something! :-)
I suppose this would fit your original idea if you wanted that
particular type signature. (Warning: not tested.)
> f :: a -> [a -> b] -> [b]
> f c fs = map ($ c) fs
>
On 20/02/07, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote:
p.f.moore:
> I'm after a function, sort of equivalent to map, but rather than
> mapping a function over a list of arguments, I want to map a list of
> functions over the same argument. The signature would be [a -> b] -> a
> -> [b], but
p.f.moore:
> I'm after a function, sort of equivalent to map, but rather than
> mapping a function over a list of arguments, I want to map a list of
> functions over the same argument. The signature would be [a -> b] -> a
> -> [b], but hoogle didn't come up with anything.
Prelude> map ($ 3) [(*2),
I'm after a function, sort of equivalent to map, but rather than
mapping a function over a list of arguments, I want to map a list of
functions over the same argument. The signature would be [a -> b] -> a
-> [b], but hoogle didn't come up with anything.
It seems like an obvious analogue of map, s