beam
beam copied to clipboard
MonadIO constraint for runBeamSqlite
Hey!
Thanks for working on Beam! Have you considered having runBeamSqlite and similar monad runners return a monad in MonadIO so they could be used in non-IO, but in MonadIO contexts?
Thanks!
So here's the thing with runBeam*, et al... they have a bracketed IO action in there which doesn't compose nicely with MonadIO. You need MonadBaseControl, but this too suffers from a few drawbacks. However, it is fairly straightforward with MonadBaseControl IO to lift the runBeam* functions in IO. I'm open to including lifted functions in a separate module though.
I've found MonadMask to be a less surprising tool for getting general bracketing.