【发布时间】:2016-10-29 23:13:43
【问题描述】:
type C = StateT Int (ErrorT String IO)
main :: C ()
main = do
args <- liftIO $ getArgs
case args of
[] -> liftIO $ putStrLn "E"
(p:ps) -> s "d"
s :: String -> C ()
我遇到了错误:
Couldn't match type ‘Control.Monad.Trans.State.Lazy.StateT
Int
(Control.Monad.Trans.Error.ErrorT String IO)
()’
with ‘IO t0’
Expected type: IO t0
Actual type: C ()
In the expression: main
When checking the type of the IO action ‘main’
我不明白为什么会出现错误以及如何修复它。请帮忙。
【问题讨论】:
标签: haskell