CloudHaskell icon indicating copy to clipboard operation
CloudHaskell copied to clipboard

Add instance MonadControlIO ProcessM

Open basvandijk opened this issue 14 years ago • 2 comments

Hi Jeff,

This patch adds an instance for MonadControlIO for ProcessM

This enables users to lift 'control' operators into a process. Control operators are things like: alloca, mask, catch, forkIO, etc.

When you have this ability you can probably remove all your custom control operators: ptry, ptimeout, pbracket and pfinally. They can be replaced by simple one-liners in terms of functions from monad-control. (I may even make an additional patch for this if you want)

Regards,

Bas

basvandijk avatar Oct 27 '11 22:10 basvandijk

As you see I went ahead and made a patch to replace ptry, pbracket and pfinally by functions from Control.Exception.Control from monad-control.

I also wanted to remove ptimeout but it turns out monad-control is not powerful enough to lift that type of control operation. So I'm planning to add a dedicated timeout function to monad-control.

basvandijk avatar Oct 27 '11 22:10 basvandijk

This is very interesting. I need some time to understand these changes before I commit them.

jepst avatar Oct 28 '11 04:10 jepst