Not sure what the right name for this notion is ... but I'm looking for:
constEffect::Sem(eff': r) -> Sem (eff ':nil': r)
The idea is that if I have a 'eff' program, and I want to create another program that includes instructions from 'eff' and 'nil' effects, return me that program even though the actual program contains instructions only from 'eff'.
Think of A, B, C as "plugins" in my software. At the user level I want the plugins to provide the commands the user (me) is supposed to use to write their program in. Having to use 'raise' brings in the knowledge of plugin hierarchy, which is an abstraction leak.
Oh, you don't want to be concrete in rows of effectful computations - that's something for interpreters/combinators - instead write Members '[A, B, C] r => Sem r a
Not sure what the right name for this notion is ... but I'm looking for:
The idea is that if I have a 'eff' program, and I want to create another program that includes instructions from 'eff' and 'nil' effects, return me that program even though the actual program contains instructions only from 'eff'.
(I do some funky merging of multiple effects, but some functions only give programs with individual effects.)
The mtl analog would be
lift
, right?There's internal
raiseUnder
(I don't think it's internal for any serious reason)Oh thanks! That actually compiled haha
I think
lift
corresponds toraise
, which adds layer on topHmm, I wonder if there's anything inherently unsafe in
Polysemy.Internal
:thinking:Can
raise
(orraise . raise ....
) be avoided in the case of a program that supports multiple effects?Think of A, B, C as "plugins" in my software. At the user level I want the plugins to provide the commands the user (me) is supposed to use to write their program in. Having to use 'raise' brings in the knowledge of plugin hierarchy, which is an abstraction leak.
Oh, you don't want to be concrete in rows of effectful computations - that's something for interpreters/combinators - instead write
Members '[A, B, C] r => Sem r a
But with
Members
you can't specify that A, B, C are the exclusive list of effects (i.e., there are no other effects), can you?commandFrom{A,B,C}
should be polymorphic -someProg
is final, concrete interpreterGotcha. I had several functions defined monomorphically using
Sem '[...] a
. That was the culprit.This now getting to be fun.
raiseUnder
ain't internal. Use it as muxh you want.