Module Shape_reduce.Make
The Make functor is used to generate a reduction function for shapes.
It is parametrized by:
- a function to load the shape of an external compilation unit
- some fuel, which is used to bound recursion when dealing with recursive shapes introduced by recursive modules. (FTR: merlin currently uses a fuel of 10, which seems to be enough for most practical examples)
- a Boolean whether projection rules that Merlin relies on should be enabled
Usage warning: To ensure good performances, every reduction made with the same instance of that functor share the same ident-based memoization tables. Such an instance should only be used to perform reduction inside a unique compilation unit to prevent conflicting entries in these memoization tables.
Parameters
module _ : sig ... endSignature
val reduce :
?diagnostics:Ocaml_typing.Shape_reduce.Diagnostics.t ->
Ocaml_typing.Env.t ->
Ocaml_typing.Shape.t ->
Ocaml_typing.Shape.tval reduce_for_uid :
Ocaml_typing.Env.t ->
Ocaml_typing.Shape.t ->
Ocaml_typing.Shape_reduce.resultPerform weak reduction and return the head's uid if any. If reduction was incomplete the partially reduced shape is returned.