Module AstMap

Mapping of kind and ordinals

Mapping functions allows to apply some treatment to some constructors and use the default treatment to recurse for the other constructor.

The output of Mapping function are bindlib's boxes, so you can use Mapping functions to bind some variables in a kind or ordinal

type self_kind = ?occ:Ast.occur -> Ast.kind -> Ast.kbox
type self_ord = ?occ:Ast.occur -> Ast.ordi -> Ast.obox
type map_kind = Ast.occur -> Ast.kind -> self_kind -> self_ord -> (Ast.kind -> Ast.kbox) -> Ast.kbox

map_kind and map_ord are the type of the function you need to write to define your own ast mapper. They receive in argument 1°) the variance of the current kind/ordinal 2°) the kind/ordinal itself 3°) the function of type self_kind corresponding to a recursive call for kind 4°) the function of type self_ord corresponding to a recursive call for ordinals 5°) the function for to call to get the defaut behavious (which copy the Ast.

type map_ord = Ast.occur -> Ast.ordi -> self_kind -> self_ord -> (Ast.ordi -> Ast.obox) -> Ast.obox
val map_kind : ?fkind:map_kind -> ?ford:map_ord -> self_kind

Mapping for kinds. The default value of the argument would just copy the kind ast.

val map_ordi : ?fkind:map_kind -> ?ford:map_ord -> self_ord

Mapping for ordinals. The default value of the argument would just copy the ordinal ast.