raiseUnder and multiple effect interpretation - Polysemy

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Torsten Schmits

What's the right way to do this:

interp1 :: Member e3 r => Sem (e1 : e2 : r) a -> Sem r a

interp2 :: Sem (e1 : e2 : r) a -> Sem r a
interp2 = interp_e3 . interp1 . raiseUnder???

It seems that I would need to introduce an effect two levels deep, but I don't see a combinator for that. Is there a better way?

Torsten Schmits

to be clear, I want e3 not to be needed in the outside interpreter stack

Torsten Schmits

which works fine when interp1 is a single effect, with raiseUnderN


I guess we should try to get

lift :: forall effs1 effs2 a. Lift effs1 effs2 => Sem effs1 a -> Sem effs2 a

at some point