- See also
- mim::plug::direct
This plugin has three jobs:
- Convert inline direct style calls to CPS (and their functions).
- Wrap DS functions to CPS functions using an axiom.
- Convert CPS functions to DS functions using an axiom.
Dependencies
Operations
%direct.cps2ds
This axiom lets the user call a CPS function in direct style. The function is not converted. Only the call site is changed.
axm %direct.cps2ds_dep: [T: *, U: T → *] → [ Fn [t: T] → U t] → [[t: T] → U t], 2;
lam %direct.cps2ds (T: *, U: *) (f: Fn T → U ): [ T → U ] = %direct.cps2ds_dep (T, λ [T]: * = U) f;
Phases
axm %direct.ds2cps_phase: %compile.Phase;
axm %direct.cps2ds_phase: %compile.Phase;
let direct_phases =
%compile.phases ff (
%direct.ds2cps_phase,
%direct.cps2ds_phase,
optimization_phase,
);