我正尝试在一个项目中使用acid-state,但在运行演示时遇到了问题。
在我的64位机器上从this example collection运行HelloWorld.hs会给出错误
acid-state.hs:26:7:
No instance for (MonadState
HelloWorldState (Update HelloWorldState))
arising from a use of `put'
Possible fix:
add an instance declaration for
(MonadState HelloWorldState (Update HelloWorldState))
In the expression: put (HelloWorldState newValue)
In an equation for `writeState':
writeState newValue = put (HelloWorldState newValue)
acid-state.hs:29:43:
No instance for (MonadReader
HelloWorldState (Query HelloWorldState))
arising from a use of `ask'
Possible fix:
add an instance declaration for
(MonadReader HelloWorldState (Query HelloWorldState))
In a stmt of a 'do' block: HelloWorldState string <- ask
In the expression:
do { HelloWorldState string <- ask;
return string }
In an equation for `queryState':
queryState
= do { HelloWorldState string <- ask;
return string }同样的事情也发生在HelloWorldNoTH.hs上。这两个错误在32位系统上都不会出现。知道这是怎么回事吗?我是否未能安装(或安装不正确)某些必需的组件?
我在64位的Debian Wheezy (通过haskell-platform包安装)上运行"The Glorious Glasgow Haskell Compilation System, version 7.4.1“,带有Cabal 0.14.0。机器本身是一个64位核心i3。这台32位机器(它成功地运行了演示程序)没有明显的区别。
发布于 2012-11-06 22:50:03
这与您运行的是哪种架构完全无关(很抱歉草率下结论)。
结果是我安装了一些错误的配置,或者可能安装了一些冲突的cabal库。清空我的.ghc,然后重新安装适当的库就行了。如果你使用的是Debian或同类软件:
rm -r ~/.ghc/*
cabal install acid-statehttps://stackoverflow.com/questions/13212836
复制相似问题