- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在沙盒中安装来自 Hackage 的最新 ghc-mod (5.2.1.1) 时遇到此错误:
[15 of 38] Compiling Language.Haskell.GhcMod.CabalConfig ( Language/Haskell/GhcMod/CabalConfig.hs, dist/dist-sandbox-94286619/build/Language/Haskell/GhcMod/CabalConfig.o )
[16 of 38] Compiling Language.Haskell.GhcMod.CabalApi ( Language/Haskell/GhcMod/CabalApi.hs, dist/dist-sandbox-94286619/build/Language/Haskell/GhcMod/CabalApi.o )
[17 of 38] Compiling Language.Haskell.GhcMod.Cradle ( Language/Haskell/GhcMod/Cradle.hs, dist/dist-sandbox-94286619/build/Language/Haskell/GhcMod/Cradle.o )
[18 of 38] Compiling Language.Haskell.GhcMod.Monad ( Language/Haskell/GhcMod/Monad.hs, dist/dist-sandbox-94286619/build/Language/Haskell/GhcMod/Monad.o )
Language/Haskell/GhcMod/Monad.hs:370:5:
Wrong category of family instance; declaration was for a type synonym
In the newtype instance declaration for ‘StM’
In the instance declaration for ‘MonadBaseControl IO (GhcModT m)’
cabal: Error: some packages failed to install:
ghc-mod-5.2.1.1 failed during the building phase. The exception was:
ExitFailure 1
我以前从未见过这个错误,所以我去挖掘了。在 Language/Haskell/GhcMod/Monad.hs
中,果然它在做一些有趣的事情:
instance (MonadBaseControl IO m) => MonadBaseControl IO (GhcModT m) where
newtype StM (GhcModT m) a = StGhcMod {
unStGhcMod :: StM (StateT GhcModState
(ErrorT GhcModError
(JournalT GhcModLog
(ReaderT GhcModEnv m) ) ) ) a }
liftBaseWith f = GhcModT . liftBaseWith $ \runInBase ->
f $ liftM StGhcMod . runInBase . unGhcModT
如果你看at monad-control在 Hackage 上,没有这样的 StM
关联的新类型,只有 StT
关联的类型。
除非这里发生了一些其他类型的诡计,否则我很难过。这将如何解决?谢谢。
最佳答案
抓破这个,我的眼睛在骗我。我的错误是,自 monad-control-1.x 以来,MonadControl 具有关联类型而不是关联数据类型,如解释的那样 here .
关于haskell - ghc-mod 期望 MonadBaseControl 具有 `StM` 关联的新类型而不是 `StT` 关联的类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27638436/
MonadBaseControl class提供很少的法律。获取something I want ,我还需要一个: forall f q. f liftBaseWith q = liftBase
我正在深入研究 Yesod 的 monad,并且遇到了 MonadBaseControl . 我看了一下hackage doc,然后迷路了。有人可以告诉我它试图解决的问题吗? 最佳答案 Michael
在模块threads中的Control.Concurrent.Thread.Group包中,有一个函数forkIO: forkIO :: ThreadGroup -> IO α -> IO (Thre
我目前正在玩 Bryan O'Sullivan 的 resource-pool图书馆并有关于扩展 withResource 的问题功能。 我想更改 withResource 的签名函数来自 (Mona
我想弄清楚如何实现 MonadBaseControl 的实例对于 Foo 类型,它是 StateT 实例的新型包装器。你会认为它会像 this 一样实现但情况似乎并非如此。我假设状态块是导致这里问题的
如何使用MonadBaseControl来自 monad-control抬起simpleHTTP happstack-server 中定义的函数? simpleHTTP 的当前类型: simpleHT
假设我有简单的 newtype 声明 newtype Foo a = Foo { unFoo :: ReaderT Int IO a } 我想制作 MonadBaseControl IO 的 Foo
我正在尝试学习 Haskell 中的 Conduits。这听起来很有趣,但类型很快就会变得非常困惑。 到目前为止,我已经编写了以下文件:https://gist.github.com/anonymou
我想用withResource :: MonadBaseControl IO m => Pool a -> (a -> m b) -> m b 来自 Data.Pool我的处理程序代码中的库。我想确定
我在沙盒中安装来自 Hackage 的最新 ghc-mod (5.2.1.1) 时遇到此错误: [15 of 38] Compiling Language.Haskell.GhcMod.CabalCo
我是一名优秀的程序员,十分优秀!