[Haskell-cafe] Re: The danger of Monad ((->) r)

Bjorn Bringert bringert at cs.chalmers.se
Tue May 15 17:07:38 EDT 2007


On May 15, 2007, at 14:52 , Tomasz Zielonka wrote:

> On Tue, May 15, 2007 at 02:27:13PM +0200, Arie Peterson wrote:
>> Hi Tomek!
>
> Hi!
>
>> Have you considered changing the statements to have type 'ReaderT  
>> Database
>> IO ()'? Then (>>) actually does what you want.
>
> I tried it and it made the code simpler, more readable and of course
> more immune to this type of bugs. Thanks!
>

I use the same idea in Hope (http://hope.bringert.net/), with a  
newtype DatabaseT, and a typeclass MonadDatabase, and lifted versions  
of the HaskellDB database operations. The code is in the first part  
of this module: http://www.cs.chalmers.se/~bringert/darcs/hope/Hope/ 
DatabaseT.hs

Perhaps this should be added to HaskellDB?

/Björn



More information about the Haskell-Cafe mailing list