小编aba*_*aba的帖子

无法推断(m~m1)

在GHC中编译此程序时:

import Control.Monad

f x = let
  g y = let
    h z = liftM not x
    in h 0
  in g 0
Run Code Online (Sandbox Code Playgroud)

我收到一个错误:

test.hs:5:21:
    Could not deduce (m ~ m1)
    from the context (Monad m)
      bound by the inferred type of f :: Monad m => m Bool -> m Bool
      at test.hs:(3,1)-(7,8)
    or from (m Bool ~ m1 Bool, Monad m1)
      bound by the inferred type of
               h :: (m Bool ~ m1 Bool, Monad m1) => t1 …
Run Code Online (Sandbox Code Playgroud)

haskell

14
推荐指数
1
解决办法
1098
查看次数

标签 统计

haskell ×1