jepst / CloudHaskell

A distributed computing framework for Haskell
http://hackage.haskell.org/package/remote
BSD 3-Clause "New" or "Revised" License
347 stars 22 forks source link

Add instance MonadControlIO ProcessM #8

Open basvandijk opened 12 years ago

basvandijk commented 12 years ago

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 commented 12 years ago

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.

jepst commented 12 years ago

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