[Haskell-cafe] Monadic Composition

Tomasz Zielonka t.zielonka at students.mimuw.edu.pl
Wed May 12 11:24:31 EDT 2004

On Wed, May 12, 2004 at 01:33:40AM +0100, Jorge Adriano Aires wrote:
> This higher order function seems quite useful to me and not trivial, so I  
> expected it to be available. When this happens I wonder if I'm missing 
> something. Am I complicating things? Is it actually available (or some other 
> that does the trick) ? Or is it just me who finds this usefull enough to be in 
> the libs?

I've used such a function at least once, in context of processing
program options (search for foldl in

So, yes, it is useful, but should it be included in a standard Monad
module? After all, this module contains mostly trivial functions ;)

BTW. You can write this function using foldM:
    compM l a = foldM (#) a l

where # is an often used reverse application operator:

    x # f = f x

Best regards,

.signature: Too many levels of symbolic links

More information about the Haskell-Cafe mailing list