
Tim Smith wrote:
Has anyone found out how to lift bracket into another monad?
Yes, please see the thread `Re: Control.Exceptions and MonadIO' staring at http://www.haskell.org/pipermail/haskell-cafe/2006-April/015444.html There is also a Haskell' ticket: http://hackage.haskell.org/trac/haskell-prime/ticket/110 We have used this CatchableMonadIO in takusen and the other project, with success. One wish is to have HUnit work in this CatchableMonadIO rather than just IO (currently Alistair Bayley has to maintain an adjusted version of HUnit for that purpose). Regarding the issue of proper disconnections from the database server: it was the thrust for the development of Takusen is to statically prevent errors like forgetting to disconnect from the database or to use the database connection after disconnecting (as well as related issues of using a cursor after closing it, or forgetting to close the cursor or to dispose the resultset). As to performance: Takusen can read and process 2 million rows from the database, in the same space it takes to fetch and process 10 rows. In fact, doing this is one of the performance tests.