Sce_core.AstSource-core syntax, parameterized by the representation of term variables.
TVar 0 is bound by the nearest enclosing TMu. TSig classifies structures; TMarr classifies module functors.
subst_typ d replacement t replaces index d, increasing the target index under each TMu. replacement must be closed: no shifting or renumbering of other free variables is performed.
Arithmetic and ordering use integers; equality uses matching primitive types; Cat concatenates strings.
val anon : binderThe conventional anonymous binder, "_".
type 'v exp = | Var of 'v| Query| Proj of 'v exp * int| Lit of lit| Unit| Lam of binder * typ * 'v exp| Box of 'v exp * 'v expThe first expression's value replaces the ambient environment.
*)| Clos of 'v exp * typ * 'v expCaptured value environment, argument type, body.
*)| App of 'v exp * 'v exp| Mrg of binder * 'v exp * 'v expIts right operand sees the left value as one new binding.
*)| Lrec of string * 'v exp| Rproj of 'v exp * string| Binop of binop * 'v exp * 'v exp| If of 'v exp * 'v exp * 'v exp| Mstruct of 'v exp| Mfunctor of sandbox * binder * typ * 'v exp| Mclos of 'v exp * typ * 'v expModule closure with a captured value environment.
*)| Mlink of 'v exp * 'v expLink a provider to a functor with one labelled import.
*)| Mapp of 'v exp * 'v exp| Nmrg of 'v exp * 'v expBoth operands run in the same ambient environment.
*)| Letb of binder * 'v exp * 'v exp| Openm of binder * 'v exp * 'v expBind a single labelled record's payload in the body.
*)| Mlinkn of 'v exp * 'v expLink every labelled import of a functor from a provider.
*)| Inl of typ * 'v expThe annotation is the other, right summand.
*)| Inr of typ * 'v expThe annotation is the other, left summand.
*)| Case of 'v exp * binder * 'v exp * binder * 'v expEach branch binds its injection payload at index zero.
*)| Flam of binder * binder * typ * typ * 'v expRecursive name, argument name, argument type, result type, body. The body sees the argument at index zero and itself at index one.
*)| Fclos of 'v exp * typ * typ * 'v expRecursive closure with a captured value environment.
*)| Fold of typ * 'v expFold (body, e) has type TMu body; the annotation is the mu body.
| Unfold of 'v expQuery denotes the complete environment. Index zero selects the right component of a merge; higher indices follow the left spine, excluding its terminal base. Runtime environments conventionally start at Unit. Binder names are retained after resolution but evaluation ignores them.
type named = string expval is_value : 'v exp -> boolThe runtime value predicate, including recursively valued environments and payloads. It does not check types or closure bodies.