[Haskell-cafe] Re: Map list of functions over a single argument

Henning Thielemann lemming at henning-thielemann.de
Wed Feb 21 08:14:27 EST 2007


On Tue, 20 Feb 2007 apfelmus at quantentunnel.de wrote:

> 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 come up with anything.
> >
> > It seems like an obvious analogue of map, so I'm pretty sure I'm
> > missing something (otherwise, I'd just write it myself, and not bother
> > :-))
> >
> > Can anyone point me in the right direction?
>
> It's also known as
>
>   sequence :: Monad m => [m b] -> m [b]
>
> with m = (->) a
>
>   sequence :: [a -> b] -> (a -> [b])
>
> This is the fabulous MonadReader.

Since there are a few questions, where 'sequence' is the answer - what
about a 'sequence' honour Wiki page?

I remember the combinatoric problem:
 http://www.haskell.org/pipermail/haskell-cafe/2006-June/015976.html


More information about the Haskell-Cafe mailing list