It is not clear to me why the type declaration is failing to compile and I am not able to interpret the compiler error, what am I missing? Below is the code with the type definition and the compiler error.
{-# LANGUAGE RankNTypes, FlexibleContexts #-}
module API.Models.RunDB where
import Control.Monad.IO.Class (MonadIO, liftIO)
import Database.Persist.Sql (ConnectionPool, runSqlPool, SqlPersistT)
import Web.Scotty (ActionM)
type RunDB = MonadIO m => (forall a. SqlPersistT IO a -> m a)
runDB' :: ConnectionPool -> RunDB
runDB' pool q = liftIO $ runSqlPool q pool
RunDB.hs:8:22: error:
Not in scope: type variable ‘m’
|
8 | type RunDB = MonadIO m => (forall a. SqlPersistT IO a -> m a)
| ^