Oops, I left out the type context:

> liftM2' :: (Monad m) => (a -> b -> m c) -> (m a -> m b -> m c)
> liftM2' proc m1 m2 = do
>   v1 <- m1
>   v2 <- m2
>   proc v1 v2

Oh, and here is a nicer definition:

  import Monad

  liftM2' :: (Monad m) => (a -> b -> m c) -> (m a -> m b -> m c)
  liftM2' proc m1 m2 = join $ liftM2 proc m1 m2

Maybe jLiftM2 is a better name?

--FC




Reply via email to