The paper Combining Deep and Shallow Embedding of Domain-Specific Languages says about this “Readers with prior knowledge about monads will recognize that Mon is similar to the continuation passing monad. The difference is that the answer type has been specialized to generate syntax trees.”
data Mon m a = M { unM :: forall b. ((a → FunC (m b)) → FunC (m b)) }
The paper Combining Deep and Shallow Embedding of Domain-Specific Languages says about this “Readers with prior knowledge about monads will recognize that Mon is similar to the continuation passing monad. The difference is that the answer type has been specialized to generate syntax trees.”
This is actually the
Codensity
monad.