CloudHaskell
CloudHaskell copied to clipboard
Add instance MonadControlIO ProcessM
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
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.
This is very interesting. I need some time to understand these changes before I commit them.