type ctyp = | Int_t type quotation = string * string option type expr = | Value of string list * string | Ident of string | Int of int | String of string | Quotation of quotation | Plus of expr * expr | App of expr * expr type nol_stm = | Quotation_stm of quotation | Expr of expr | Decl of (string * string list * expr * ctyp option) type t = nol_stm list let stm2expr l = List.map (function | Expr e -> e | _ -> failwith "not an Expr") l let stm2decl l = List.map (function | Decl (name, args, e, t) -> (name, args, e, t) | _ -> failwith "not a Decl") l let stm2quot l = List.map (function | Quotation_stm (s, t) -> (s, t) | _ -> failwith "not a Quotation_stm") l