Skip to content

Instantly share code, notes, and snippets.

@jg
Created July 19, 2014 18:52
Show Gist options
  • Save jg/bf0dd9c8023cdb2dfd20 to your computer and use it in GitHub Desktop.
Save jg/bf0dd9c8023cdb2dfd20 to your computer and use it in GitHub Desktop.
connectionUrl :: Reader Config B.ByteString
-- withConnection
-- :: (Database.PostgreSQL.Simple.Internal.Connection -> IO c)
-- -> ReaderT Config Data.Functor.Identity.Identity (IO c)
withConnection f = do
url <- connectionUrl
return $ bracket (connectPostgreSQL url) (close) f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment