[Haskell-cafe] using IO monad in Iteratee
Dmitry Olshansky
olshanskydr at gmail.com
Sat Apr 2 11:38:41 CEST 2011
Very interesting, thanks.
I didn't feel your classes yet... Do you think that provide these instances
for Iteratee is possible?
2011/4/2 Bas van Dijk <v.dijk.bas at gmail.com>
> On 1 April 2011 21:59, Dmitry Olshansky <olshanskydr at gmail.com> wrote:
> > Is it possible to change enumFile to using MonadIO class?
>
> No because it uses the control operation Control.Exception.finally ::
> IO a -> IO b -> IO a internally. You can't lift control operations
> with liftIO :: MonadIO m => IO a -> m a.
>
> However if you are able to define a MonadTransControl and
> MonadControlIO instance (from the monad-control package[1]) for
> Iteratee and use Control.Exception.Control.finally instead of the
> regular finally, you can use your MyMonad with the modified enumFile.
>
> Good luck,
>
> Bas
>
> [1] http://hackage.haskell.org/package/monad-control
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110402/48cf4ca3/attachment.htm>
More information about the Haskell-Cafe
mailing list