相关疑难解决方法(0)

runST和函数组合

为什么这个类型检查:

runST $ return $ True
Run Code Online (Sandbox Code Playgroud)

虽然以下不是:

runST . return $ True
Run Code Online (Sandbox Code Playgroud)

GHCI抱怨:

Couldn't match expected type `forall s. ST s c0'
            with actual type `m0 a0'
Expected type: a0 -> forall s. ST s c0
  Actual type: a0 -> m0 a0
In the second argument of `(.)', namely `return'
In the expression: runST . return
Run Code Online (Sandbox Code Playgroud)

haskell function-composition

53
推荐指数
2
解决办法
3254
查看次数

标签 统计

function-composition ×1

haskell ×1