Module Frames.Make

Parameters

module S : SLOT

Signature

type env = S.t list

Slots are ordered innermost first, so the list head has index zero.

val empty : env
val nth : env -> int -> S.t option

nth env i returns None beyond the end and raises Invalid_argument if i is negative.

val lam : S.t -> env -> env

Each of these binding forms adds one slot at index zero.

val letb : S.t -> env -> env
val mrg : S.t -> env -> env
val openm : S.t -> env -> env
val case_branch : S.t -> env -> env
val nmrg : S.t -> env -> env

A non-dependent merge preserves its ambient context; the slot argument is ignored.

val flam : self:S.t -> arg:S.t -> env -> env

The argument becomes index zero and the recursive function index one.

val sandbox : env -> env

Discard outer slots before adding a sandboxed functor's parameter.

val box : env -> env

Discard names on entry to a box. Its replacement environment's shape is not available to name resolution; access it through explicit queries.