Skip to content

Instantly share code, notes, and snippets.

@balajisivaraman
Created November 26, 2016 15:33
Show Gist options
  • Save balajisivaraman/91700e1defbf64f90928aede72d67e95 to your computer and use it in GitHub Desktop.
Save balajisivaraman/91700e1defbf64f90928aede72d67e95 to your computer and use it in GitHub Desktop.
Reader Monad Resource Management
val getJDBCConnection: Reader[JDBCConf, Connection] = ???
val getStatement: Reader[Connection, PreparedStatement] = ???
val executeQuery: Reader[PreparedStatement, ResultSet] = ???
val queryExecutor: Reader[JDBCConf, ResultSet] = getJDBCConnection.andThen(getStatement).andThen(executeQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment