-fmapMMaybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)
-fmapMMaybe _ Nothing = return Nothing
-fmapMMaybe f (Just x) = f x >>= \x' -> return (Just x')
+instance Monad m => Monad (MaybeT m) where
+ return = MaybeT . return . Just
+ x >>= f = MaybeT $ runMaybeT x >>= maybe (return Nothing) (runMaybeT . f)
+ fail _ = MaybeT $ return Nothing