Module Type_generic.Named.Context

module Context: sig .. end
Work in progress representation of a computation. This is mostly used to handle recursive types. While building a computation on a recursive type, one needs to have some computation available for the location where the type appears recursively. init will be called once on each new type_name met during the traversal of a type. Each time the same type is encountered again, get_wip_computation will be called. At the end of the traversal of that particular type, set_final_computation will be called, offering as a way to "close" the wip representation. 'a t can be mutable (and is likely to be in practice).

After a set_final_computation is performed and return a final computation C for a type_name, C will be memoized and returned for each further occurrences of the same type_name inside the typerep, going further on.


type t 
Mutable context used to memorize some info during the traversal of a typerep. A new context is created before starting to enter the toplevel of a typerep. Then it is passed to all init calls that happen during the traversal of it. The user of the generic functor is free to stuff there whatever context needs to be available while creating a new value of type 'a Named.t
val create : unit -> t