In search of: [a->b] -> a -> [b]

Wolfgang Lux wlux@uni-muenster.de
Fri, 20 Jun 2003 14:03:43 +0200


Christian Sievers wrote:

> This is a case where I'd prefer a list comprehension:
>
> flist fs a = [ f a | f <- fs ]
>
> (and this could be a monad comprehension, if Haskell still had them...)

And it still has them, you just have to get accustomed to the slightly
different syntax :-)

   flist fs a = do f <- fs; return (f a)

Wolfgang