Well, polysemy uses final encoding of free monad, with interface that resembles that of final tagless approach, so comparing to those approaches it's sort of hybrid:
because actions are embedded into free encoding (in Sem) instead of directly into concrete final monad, we're free to introduce multiple interpretations of same effect without having to do "newtype wrangling" on final monad
because membership of effects in application code is described in constraint instead of final type, embedding of "subsystems" happens sort of "automatically" - final row just gets more constraints to satisfy
That example from "The straw man argument" section would be something like:
How does all of this relate (in terminology) to polysemy?
https://old.reddit.com/r/haskell/comments/ggm494/hierarchical_free_monads_mostly_pointless/
Well,
polysemy
uses final encoding of free monad, with interface that resembles that of final tagless approach, so comparing to those approaches it's sort of hybrid:Sem
) instead of directly into concrete final monad, we're free to introduce multiple interpretations of same effect without having to do "newtype wrangling" on final monadThat example from "The straw man argument" section would be something like:
in
polysemy
(haven't typechecked though :big_smile:)