Re: bracket, (un)block and MonadIO

2003-09-04 Thread John Meacham
On Thu, Sep 04, 2003 at 10:45:17AM +0100, Simon Marlow wrote: > > However, the definition of bracket relies on block and > > unblock, which have the > > following types: > > > bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c > > > block :: IO a -> IO a > > > unblock :: IO a -> IO a > > > > T

Re: bracket, (un)block and MonadIO

2003-09-04 Thread sebc
Hi, On Thu, Sep 04, 2003 at 10:45:17AM +0100, Simon Marlow wrote: > > > > Would anything prevent block, unblock, bracket (and other similar > > functions working on IO actions) from being generalized to all > > intances of MonadIO? > > I'm afraid I can't see a way to generalise the types of block

RE: bracket, (un)block and MonadIO

2003-09-04 Thread Simon Marlow
> However, the definition of bracket relies on block and > unblock, which have the > following types: > > bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c > > block :: IO a -> IO a > > unblock :: IO a -> IO a > > This forces f to be an IO action in the above withQuery > function. If bracke

bracket, (un)block and MonadIO

2003-09-02 Thread Lunar
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I'm trying to make generic helper functions for database querying. I would like to be able to define functions that work for every monad that holds a database connection and is built on top of the IO monad. For this, I have defined the follow