haskus / packages

Haskus packages
https://haskus.org/
24 stars 11 forks source link

Add MonadMask instance for FlowT ? #14

Open fonghou opened 5 years ago

fonghou commented 5 years ago

Hi,

FlowT in 2.4 is a very ergonomic alternative compare to Variant on the Left of Either. I like it a lot. Just want to bring up an enhancement for discussion.

Since it has a MonadIO instance, should FlowT also provide MonadMask instance (and its superclass instances)?

http://hackage.haskell.org/package/exceptions-0.10.0/docs/Control-Monad-Catch.html#v:generalBracket

btw, I'm not proposing that FlowT needs all n^2 mtl instances because Variant on the Left of ExceptT already serves that purpose well enough for now.

Thanks! Feng

hsyl20 commented 5 years ago

Hi, I've just added the instances (adapted from ExceptT's ones) but I haven't tested them yet. Tell me if something goes wrong! Thanks!