> tor 2003-08-21 klockan 22.26 skrev Jon Cast: > > Yes. Many complicated proposals have been made, but there's a > > straightforward, general mechanism: > > > > > addMaybe :: Num alpha => Maybe alpha -> Maybe alpha -> Maybe alpha > > > addMaybe a b = a >>= \x -> > > > b >>= \y -> > > > return (x + y) > > > > or > > > > > addMaybe a b = do > > > x <- a > > > y <- b > > > return (x + y) > > or > > addMaybe = Monad.liftM2 (+) > > I personally use those monadic lifting functions a lot. Monad.sequence > combined with list comprehension is another favorite.
So do I. But that style doesn't work as well with functions that are already in the monad. So, I mentioned the more general style. Jon Cast _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe