如何从Control.Monad.liftM not
到Control.Monad.liftM not id
的类型进行类型推断?
(Control.Monad.liftM not) :: Monad m => m Bool -> m Bool
(Control.Monad.liftM not id) :: Bool -> Bool
答案 0 :(得分:4)
liftM not :: Monad m => m Bool -> m Bool
id :: a -> a
liftM not id :: (Monad m, m ~ ((->) a), a ~ Bool) => m Bool
{- therefore -} Bool -> Bool