Maurício wrote:
Hi,
If I have two computations a->IO b
and b->IO c, can I join them to
get an a->IO c computation? I imagine
something like a liftM dot operator.
You've already been shown the >=> operator and how to define it from >>=
by other answers.
Just for variety, here is how you would define it using do notation:
compose :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
compose act act' a = do
b <- act a
act' b
Jules
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe