interpretW ::
forall eff lb ub es a wrap.
lb wrap =>
(forall x. x -> Eff lb ub es (wrap x)) ->
HandlerW eff lb ub es wrap ->
Eff lb ub (eff : es) a ->
Eff lb ub es (wrap a)
interpretW wrap f =
interpretRaw
isoSomeId
wrap
\eff lb _ lifter next -> Eff \facts -> do
case first (effUn facts) $ f (sendIt lifter) eff of
(Pure a, continue) -> effUn facts $ continue $ runLinearCf a next
(Impure eff lb' ub' lifter' next', continue) ->
Impure eff lb' ub' lifter' $
CfOnce lb (lifter . Deeper) (CfRun continue next) next'