Zulip Chat Archive

Stream: new members

Topic: MonadLift and semiOutParam


Simon Daniel (Mar 09 2024 at 23:08):

Can i write MonadLift instances for parameterized Monads? When trying to

inductive PrintEff (s:String): Type -> Type 1
| print: PrintEff s Unit

instance (s:String): MonadLift (PrintEff s) IO where
  monadLift x := match x with
   | .print => IO.println s

i get the info that MonadLift takes an semiOutParam (Type u → Type v). From the Docs I interpret this as: there cannot occur any free variables (like s in my example).
Ist this correct or is there a way to write such a instance?


Last updated: May 02 2025 at 03:31 UTC