Closed facundominguez closed 4 years ago
This proposal sounds good to me. I think Control.Monad.Lift.Linear
in linear-base would be an appropriate place for the MonadLift
class, and MonadIO
can live in Control.Monad.IO.Class
.
I have moved the Extra modules for linear-base
to https://github.com/tweag/linear-base/pull/64
The linear interfaces were using
Linear.IO
, that might not be particularly easy to integrate in applications which use other monads.I propose here a class to lift non-linear monads into linear monads. jni uses this to offer operations that run on any linear monad that can lift the non-linear
IO
.Thus, an application can provide an instance of
Linear.Monad
for any wrapper of a regularly looking monadic stack. e.g.