Up

Module Common

Signature

val lident : string -> Longident.t
val core_type_of_type_declaration : Parsetree.type_declaration -> Parsetree.core_type
val combinator_type_of_type_declaration : Parsetree.type_declaration -> f:(loc:Location.t -> Parsetree.core_type -> Parsetree.core_type) -> Parsetree.core_type
val gen_symbol : ?prefix:string -> unit -> string

gensym ?prefix () generates a fresh variable name with prefix.

Param [prefix] default = "_x"
val string_of_core_type : Parsetree.core_type -> string
val assert_no_attributes : Parsetree.attributes -> unit
val assert_no_attributes_in : Ast_traverse.iter
val get_type_param_name : Parsetree.core_type * Asttypes.variance -> string Location.loc

get_tparam_id tp

Returns the string identifier associated with tp if it is a type parameter.
val types_are_recursive : ?stop_on_functions:bool -> ?short_circuit:(Parsetree.core_type -> bool option) -> Parsetree.type_declaration list -> bool

Returns whether the given type declarations refer to themselves.

short_circuit allows you to override the search for certain type expressions.

stop_on_functions allows to disregard the recursive occurences appearing in arrow types. The default is to disregard them.

val really_recursive : Asttypes.rec_flag -> Parsetree.type_declaration list -> Asttypes.rec_flag
val loc_of_payload : Parsetree.attribute -> Location.t
val loc_of_attribute : Parsetree.attribute -> Location.t
val curry_applications : Parsetree.expression -> Parsetree.expression

convert multi-arg function applications into a cascade of 1-arg applications