简体   繁体   中英

Haskell type inference about monad

How can I do the type inference from the type of Control.Monad.liftM not to Control.Monad.liftM not id ?

(Control.Monad.liftM not) :: Monad m => m Bool -> m Bool

(Control.Monad.liftM not id) :: Bool -> Bool
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM