Skip to content

Instantly share code, notes, and snippets.

@NathanHowell
Forked from jg/ReaderT
Created July 20, 2014 07:39
Show Gist options
  • Save NathanHowell/8062519e4524bd2d7e30 to your computer and use it in GitHub Desktop.
Save NathanHowell/8062519e4524bd2d7e30 to your computer and use it in GitHub Desktop.
connectionUrl :: Monad m => ReaderT m Config B.ByteString
-- withConnection
-- :: (Database.PostgreSQL.Simple.Internal.Connection -> IO c)
-- -> ReaderT Config IO c
withConnection f = do
url <- connectionUrl
liftIO $ bracket (connectPostgreSQL url) close f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment