initPersistent的Snaplet持久性问题

时间:2015-01-26 01:53:44

标签: haskell persistent haskell-snap-framework

我是Haskell的初学者,尝试使用snaplet-persistent。试图按照文档但它不起作用,出现问题:

src/Site.hs:120:32:
    No instance for (MonadBaseControl
                       IO (Initializer App PersistState))
      arising from a use of ‘initPersist’
    In the second argument of ‘($)’, namely
      ‘initPersist (runMigrationUnsafe migrateAuth)’
    In a stmt of a 'do' block:
      d <- nestSnaplet "db" db
           $ initPersist (runMigrationUnsafe migrateAuth)
    In the second argument of ‘($)’, namely
      ‘do { h <- nestSnaplet "" heist $ heistInit "templates";
            s <- nestSnaplet "sess" sess
                 $ initCookieSessionManager "site_key.txt" "sess" (Just 3600);
            d <- nestSnaplet "db" db
                 $ initPersist (runMigrationUnsafe migrateAuth);
            a <- nestSnaplet "auth" auth
                 $ initPersistAuthManager sess (persistPool $ view snapletValue d);
            .... }’

从github运行snaplet-persistent。

1 个答案:

答案 0 :(得分:0)