| 1 | open! Base |
| 2 | open! Ppxlib |
| 3 | |
| 4 | (** Constructs a branch of a [match] or [function] expression with no guard. *) |
| 5 | val ( --> ) : pattern -> expression -> case |
| 6 | |
| 7 | (** Replace all type variables like ['a] with wildcard ([_]) types. *) |
| 8 | val replace_variables_by_underscores : core_type -> core_type |
| 9 | |
| 10 | (** Create a binding for a derived function, adding a type annotation if required. *) |
| 11 | val constrained_function_binding |
| 12 | : location (** location to use for the binding *) |
| 13 | -> type_declaration (** type declaration used to derive the function *) |
| 14 | -> core_type (** type of the function *) |
| 15 | -> tps:string loc list (** names of type parameters in the declaration *) |
| 16 | -> func_name:string (** name to bind the function to *) |
| 17 | -> expression (** expression representing the function *) |
| 18 | -> value_binding |
| 19 | |
| 20 | (** Wraps an expression in layers of non-recursive [let] bindings, with the bindings |
| 21 | sorted from outermost to innermost. *) |
| 22 | val with_let : loc:location -> binds:value_binding list list -> expression -> expression |
| 23 | |
| 24 | (** Wraps an expression in [let open] containing type declarations, if non-empty. *) |
| 25 | val with_types : loc:location -> types:type_declaration list -> expression -> expression |
| 26 | |
| 27 | (** Constructs a lambda of a fresh variable. Passes a reference to that variable as [arg] |
| 28 | to construct the lambda's body. *) |
| 29 | val fresh_lambda : loc:location -> (arg:expression -> expression) -> expression |
| 30 | |
| 31 | (** Conservative approximation of which expressions are syntactically values, i.e. |
| 32 | constants, variables, or lambdas. When [true], these expressions have no effects |
| 33 | (other than possibly closure allocation) and can be used in [let rec] definitions. |
| 34 | When [false], they may need to be eta-expanded or wrapped in [lazy]. *) |
| 35 | val is_value_expression : expression -> bool |
| 36 | |
| 37 | (** Shadows [Ppxlib.really_recursive] with a version that respects the [[@opaque]] |
| 38 | attribute. *) |
| 39 | val really_recursive_respecting_opaque : rec_flag -> type_declaration list -> rec_flag |
| 40 | |
| 41 | val strip_attributes : Ast_traverse.map |