# Pastebin 93RjtIYP #!/usr/bin/env stack -- stack --resolver lts-18.2 exec ghci --package mtl --package persistent {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} import Control.Monad.Reader import Data.Functor.Identity import Database.Persist.Sql (SqlPersistT) funcOne :: (MonadReader env m) => Int -> SqlPersistT m () funcOne i = do _ <- do backend <- ask x <- runReaderT (runReaderT funcTwo backend) i pure () pure () funcTwo :: (MonadReader Int m) => SqlPersistT m () funcTwo = undefined