Search code examples
haskellpersistenthaskell-snap-framework

Snaplet-persistent problems with initPersistent


I am a beginner in Haskell, trying to use snaplet-persistent. Tried to follow the documentation but it is not working, the problem that is appearing :

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);
            .... }’

Running snaplet-persistent from github.


Solution

  • That was solved in github by eryx67