Module Lam

type apply_status =
  1. | App_na
  2. | App_infer_full
  3. | App_uncurry
;
type ident = Ident.t;
type lambda_switch = {
  1. sw_consts_full: bool,
  2. sw_consts: list((int, t)),
  3. sw_blocks_full: bool,
  4. sw_blocks: list((int, t)),
  5. sw_failaction: option(t),
  6. sw_names: option(Melange_compiler_libs.Lambda.switch_names),
};
and apply = pri {
  1. ap_func: t,
  2. ap_args: list(t),
  3. ap_info: ap_info,
};
and lfunction = {
  1. arity: int,
  2. params: list(ident),
  3. body: t,
  4. attr: Melange_compiler_libs.Lambda.function_attribute,
};
and prim_info = pri {
  1. primitive: Lam_primitive.t,
  2. args: list(t),
  3. loc: Melange_compiler_libs.Location.t,
};
and t = pri
  1. | Lvar(ident)
  2. | Lmutvar(ident)
  3. | Lglobal_module(ident)
  4. | Lconst(Lam_constant.t)
  5. | Lapply(apply)
  6. | Lfunction(lfunction)
  7. | Llet(Lam_compat.let_kind, ident, t, t)
  8. | Lmutlet(ident, t, t)
  9. | Lletrec(list((ident, t)), t)
  10. | Lprim(prim_info)
  11. | Lswitch(t, lambda_switch)
  12. | Lstringswitch(t, list((string, t)), option(t))
  13. | Lstaticraise(int, list(t))
  14. | Lstaticcatch(t, (int, list(ident)), t)
  15. | Ltrywith(t, ident, t)
  16. | Lifthenelse(t, t, t)
  17. | Lsequence(t, t)
  18. | Lwhile(t, t)
  19. | Lfor(ident, t, t, Asttypes.direction_flag, t)
  20. | Lassign(ident, t)
  21. | Lsend(Melange_compiler_libs.Lambda.meth_kind, t, t, list(t), Melange_compiler_libs.Location.t)
;
let inner_map: t => (t => t) => t;
let var: ident => t;

Smart constructors

let mutvar: ident => t;
let global_module: ident => t;
let const: Lam_constant.t => t;
let apply: t => list(t) => ap_info => t;
let function_: attr:Melange_compiler_libs.Lambda.function_attribute => arity:int => params:list(ident) => body:t => t;
let let_: Lam_compat.let_kind => ident => t => t => t;
let mutlet: ident => t => t => t;
let letrec: list((ident, t)) => t => t;
let if_: t => t => t => t;

constant folding

let switch: t => lambda_switch => t;

constant folding

let stringswitch: t => list((string, t)) => option(t) => t;

constant folding

let false_: t;
let unit: t;
let sequor: t => t => t;

convert l || r to if l then true else r

let sequand: t => t => t;

convert l && r to if l then r else false

constant folding

let seq: t => t => t;

drop unused block

let while_: t => t => t;
let try_: t => ident => t => t;
let assign: ident => t => t;
let prim: primitive:Lam_primitive.t => args:list(t) => Melange_compiler_libs.Location.t => t;

constant folding

let staticcatch: t => (int, list(ident)) => t => t;
let staticraise: int => list(t) => t;
let for_: ident => t => t => Asttypes.direction_flag => t => t;
let eq_approx: t => t => bool;