YesodPersist实例声明中的类型不匹配

时间:2014-11-26 23:07:35

标签: haskell yesod persist

这是我的项目(原始资料来自FP Haskell中心,但我不知道如何公开提供它)https://github.com/geraldus/EsqueletoTest

有YesodPersist实例声明

instance YesodPersist App where
    type YesodPersistBackend App = SqlBackend -- line 19

    runDB action = do
        App pool <- getYesod
        runSqlPool action pool

我有以下错误:

src/Foundation.hs@19:36-19:46 Kind mis-match
Expected kind `(* -> *) -> * -> *', but SqlBackend has kind * …
In the type `SqlBackend'
In the type synonym instance declaration for `YesodPersistBackend'
In the instance declaration for `YesodPersist App'

出了什么问题?

1 个答案:

答案 0 :(得分:1)

看起来您最初使用Persistent 2编写代码,现在使用Persistent 1.3。在1.3上,你需要像type YesodPersistBackend App = SqlPersistT这样的东西。