YesSOD和MySQL连接问题
我一直在网上寻找一个可以将YesSOD和MySQL连接问题,mysql,haskell,yesod,Mysql,Haskell,Yesod,我一直在网上寻找一个可以将Yesod-Persistent连接到MySQL数据库的工作示例,我发现了这个 当我使用ghci尝试此代码时,我得到以下错误: Prelude> :l test3.hs [1 of 1] Compiling Main ( test3.hs, interpreted ) test3.hs:35:27: Couldn't match type `persistent-2.2.2.1:Database.Persist.Sql.Type
Yesod
-Persistent
连接到MySQL数据库的工作示例,我发现了这个
当我使用ghci
尝试此代码时,我得到以下错误:
Prelude> :l test3.hs
[1 of 1] Compiling Main ( test3.hs, interpreted )
test3.hs:35:27:
Couldn't match type `persistent-2.2.2.1:Database.Persist.Sql.Types.SqlBackend'
with `SqlBackend'
Expected type: Migration
Actual type: persistent-2.2.2.1:Database.Persist.Sql.Types.Migration
In the first argument of `printMigration', namely `migrateAll'
In a stmt of a 'do' block: printMigration migrateAll
In the second argument of `($)', namely
`do { printMigration migrateAll }'
Failed, modules loaded: none.
我被困在里面了
我的另一个问题是:有人有Yesod+MySQL的经验吗?如果是,我想知道这是一个好的选择还是一个有问题的选择。看起来您安装了两个版本的软件包。如果使用Stack安装,它将确保范围内每个包只有一个版本。我在中详细描述了这种情况。请阅读和@RiggsFolly它可能对其他用户有用,网络上关于这方面的资源很少。没关系,4个其他人必须同意我的观点才能采取行动这里的一个实际问题是:GHC(Haskell编译器)的原因是什么错误消息“无法将类型包foo:Bar与Bar匹配”。
Prelude> :l test3.hs
[1 of 1] Compiling Main ( test3.hs, interpreted )
test3.hs:35:27:
Couldn't match type `persistent-2.2.2.1:Database.Persist.Sql.Types.SqlBackend'
with `SqlBackend'
Expected type: Migration
Actual type: persistent-2.2.2.1:Database.Persist.Sql.Types.Migration
In the first argument of `printMigration', namely `migrateAll'
In a stmt of a 'do' block: printMigration migrateAll
In the second argument of `($)', namely
`do { printMigration migrateAll }'
Failed, modules loaded: none.