No instance for Control.Monad.Logger.MonadLogger when attempting to use persistent No instance for Control.Monad.Logger.MonadLogger when attempting to use persistent database database

No instance for Control.Monad.Logger.MonadLogger when attempting to use persistent


runNoLoggingT has the type

runNoLoggingT :: NoLoggingT m a -> m a

and it's a valid MonadLogger so long as m above is an instance of MonadIO. All of the following stacks are instances of MonadIO

SqlPersist (ResourceT IO)            ResourceT IO                      IO

So all of the following stacks are valid instances of MonadLogger

NoLoggingT (SqlPersist (ResourceT IO))SqlPersist (NoLoggingT (ResourceT IO))SqlPersist (ResourceT (NoLoggingT IO))

I'd recommend the third, then we just edit

runDb :: SqlPersist (ResourceT (NoLoggingT IO)) a -> IO arunDb = runNoLoggingT       . runResourceT       . withSqliteConn "dev.app.sqlite3"       . runSqlConn