module Make: functor (
X
:
sig
type 'a
t
val name : string
val required : Type_generic.Ident.t list
include Type_generic.Computation
end
) ->
S
with type 'a t = 'a X.t
The name
is used for debug information only in case of Broken_dependency.
The required
is to handle dependencies between generics at runtime.
Example:
if X
is the module given to build a generic computation G
that depends on three
other computation A,B,C
then X.required shall be A.ident ; B.ident ; C.ident
Parameters: |
X |
: |
sig
type 'a t
val name : string
val required : Ident.t list
include Computation
with type 'a t := 'a t
end
|
|
type 'a
t
type 'a
computation = 'a t
val ident : Type_generic.Ident.t
exception Not_implemented of string * string
generic_ident * typename or info
include Type_generic_intf.S
register mechanism to customize the behavior of this generic
val register0 : (module S0) -> unit
Extending an existing generic for a particular type name
The use of first class modules there is essentially because we cannot talk about a
variable of kind * -> k
val register1 : 'a 't Typerep.t -> ('a computation -> 'a 't computation) -> unit
...
val register1 : (module S1) -> unit
val register2 : (module S2) -> unit
val register3 : (module S3) -> unit
val register4 : (module S4) -> unit
val register5 : (module S5) -> unit
val register : 'a Std_internal.Typerep.t -> 'a computation -> unit
special less scary type when the type has no parameters. this is equivalent as
using register0
val of_typerep : 'a Std_internal.Typerep.t -> [ `generic of 'a computation ]
main function : compute the generic computation from the typerep
module Computation: Type_generic.Computation
with type 'a t = 'a t
exported to build a computation on top of a previous one