123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899open!Coreopen!ImportmoduletypeUp=sig(** Values of type [Up.t] are passed from child to parent during a transformation.
For transformations that use the fallback "skipping-over" recursion, the default
transformer needs to know how to allocate empty [Up.t] values, and combine [Up.t]
for computations that have more than one child. *)typetvalcombine:t->t->tvalempty:t(** [Computation.lazy] is an obstacle to optimization in many cases. To force
optimization authors to think about [lazy], we have a special empty value.
Optimizations get applied to [Computation.lazy] when it is forced, rather
than immediately. Thus, we use a constant, [empty_for_lazy], as the value
that is passed back to the parent computation. *)valempty_for_lazy:tendmoduletypeTypes=sig(** Values of type [Down.t] are passed from parent to child during a transformation. *)moduleDown:T(** Values of type [Acc.t] are threaded through the computational transformation in a
depth-first manner. *)moduleAcc:TmoduleUp:UpendmoduleUnit:Upwithtypet=unit=structtypet=unitletcombine()()=()letempty=()letempty_for_lazy=()endmoduletypeRecurse=sig(** A module with signature [Recurse] is passed to the transformation implementation. Use
of values in this module is necessary for the transformation to recurse. The main
value that this API provides is that it allows transformation authors to skip
computation constructors that they can't do anything for, while still applying their
transformation to children of that node. *)moduleTypes:Types(** [on_computation] is the function that a user of the transform API must call to
recursively transform a computation. The main feature of it is the ability for the
caller to skip applying their transformation to the provided node, while still
applying it to the children of that node. This behavior is produced by providing
[`Skipping_over] to the function, while [`Directly_on] will run the users
transformation on the node. *)valon_computation:Types.Down.t->Types.Acc.t->[`Directly_on|`Skipping_over]->'aComputation.t->Types.Acc.t*Types.Up.t*'aComputation.t(** Like [on_computation], but for values instead. *)valon_value:Types.Down.t->Types.Acc.t->[`Directly_on|`Skipping_over]->'aValue.t->Types.Acc.t*Types.Up.t*'aValue.tendmoduletypeTransform=sigmoduleTypes:Typesvaltransform_c:Types.Down.t->Types.Acc.t->'aComputation.t->Types.Acc.t*Types.Up.t*'aComputation.tvaltransform_v:Types.Down.t->Types.Acc.t->'aValue.t->Types.Acc.t*Types.Up.t*'aValue.tendmoduletypeS=sigmoduleUnit=UnitmoduletypeRecurse=RecursemoduleMake(Types:Types)(_:functor(_:RecursewithmoduleTypes:=Types)->TransformwithmoduleTypes:=Types):TransformwithmoduleTypes:=Typesend