package catala

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Program declaration context helpers

val empty_ctx : Shared_ast__.Definitions.decl_ctx

Transformations

val map_decl_ctx : f: (Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos -> Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos) -> Shared_ast__.Definitions.decl_ctx -> Shared_ast__.Definitions.decl_ctx
val map_exprs : ?typ: (Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos -> Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos) -> f:('expr1 -> 'expr2 Shared_ast__.Definitions.boxed) -> varf:('expr1 Var.t -> 'expr2 Var.t) -> 'expr1 Shared_ast__.Definitions.program -> 'expr2 Shared_ast__.Definitions.program

If typ is specified, definitions in decl_ctx are also processed

val fold_left : f:('a -> 'expr Shared_ast__.Definitions.code_item -> 'a) -> init:'a -> 'expr Shared_ast__.Definitions.program -> 'a
val fold_exprs : f: ('a -> 'expr -> Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos -> 'a) -> init:'a -> 'expr Shared_ast__.Definitions.program -> 'a
val fold_right : f:('expr Shared_ast__.Definitions.code_item -> 'a -> 'a) -> init:'a -> 'expr Shared_ast__.Definitions.program -> 'a
val get_scope_body : ((_ Shared_ast__.Definitions.any, _ Shared_ast__.Definitions.any, 't) Shared_ast__.Definitions.base_gexpr, 't Shared_ast__.Definitions.mark) Catala_utils.Mark.ed as 'e Shared_ast__.Definitions.program -> Shared_ast__.Definitions.ScopeName.t -> 'e Shared_ast__.Definitions.scope_body
val untype : (('a Shared_ast__.Definitions.any, 'a Shared_ast__.Definitions.any, _) Shared_ast__.Definitions.base_gexpr, _ Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.program -> (('a, 'a, Shared_ast__.Definitions.untyped) Shared_ast__.Definitions.base_gexpr, Shared_ast__.Definitions.untyped Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.program
val to_expr : ((_ Shared_ast__.Definitions.any, _ Shared_ast__.Definitions.any, _) Shared_ast__.Definitions.base_gexpr, _ Shared_ast__.Definitions.mark) Catala_utils.Mark.ed as 'e Shared_ast__.Definitions.program -> Shared_ast__.Definitions.ScopeName.t -> 'e Shared_ast__.Definitions.boxed

Usage: build_whole_program_expr program main_scope builds an expression corresponding to the main program and returning the main scope as a function.

val find_scope : Shared_ast__.Definitions.ScopeName.t -> ('e, 'e Shared_ast__.Definitions.code_item, unit) Shared_ast__.Definitions.bound_list -> 'e Shared_ast__.Definitions.scope_body
val modules_to_list : Shared_ast__.Definitions.module_tree -> Catala_utils.Uid.Module.t list

Returns a list of used modules, in topological order

OCaml

Innovation. Community. Security.