module Make: functor (
T
:
sig
type
t
Type used to build the first-class-value type.
val dummy : t
A dummy value.
val name : string
Name of the kind to generate (debugging purpose only).
val kind_name : t -> string
Name of a value of type t
.
end
) ->
sig
.. end
Kind generator.
Parameters: |
T |
: |
sig
type t (** Type used to build the first-class-value type. *)
val dummy: t (** A dummy value. *)
val name: string
(** Name of the kind to generate (debugging purpose only). *)
val kind_name: t -> string
(** Name of a value of type [t]. *)
end
|
|
type
t
Type of kinds (roughly speaking, a second-order type) which the values
have type T.t
.
val dummy : t
A dummy kind.
module Selection: Kind.SELECTION
with type kind = t
Selection for this type of kinds.
val create : T.t -> t list -> t
Create a new kind from a value with some dependencies. create
is a
bijection.
If ocaml assertions are checked, some verifications about the
well-foundness of the dependency graph extended with this kind are
performed (using the name of the kind, given by T.kind_name
).
val value : t -> T.t
Inverse of create
.
exception DependencyAlreadyExists of string * string
May be raised by add_dependency
.
val add_dependency : t -> t -> unit
add_dependency k1 k2
indicates that the kind k1
depends on the kind
k2
, that is an action of the kind k2
must be done before one of the
kind k1
.
Raises DependencyAlreadyExists
if such a dependency already exists.
val iter : (T.t -> 'a -> unit) -> 'a -> unit
iter f x
applies f k x
for each kind k
of type t
. Order of
applications is not specified.
val apply_in_order : Selection.t ->
Selection.t -> (t -> 'a -> 'a) -> 'a -> 'a
apply_in_order only except f x
folds f
for of each kind of type t
(or for each kind specified by only
and except
if one of them is
non-empty), begining to acc
and following a topological order of
kinds dependencies.
val iter_in_order : Selection.t ->
Selection.t -> (T.t -> 'a -> unit) -> 'a -> unit
iter_in_order only except f x
applies f v x
for each kind value v
of type T.t
(or for each kind specified by only
and
except
if one of them is non-empty), following the same order as
apply_in_order.
val fold_in_order : Selection.t ->
Selection.t -> (T.t -> 'a -> 'a) -> 'a -> 'a
fold_in_order only except f acc
folds f v x
for each kind value v
of type T.t
(or for each kind specified by only
and
except
if one of them is non-empty), begining to acc
and following
the same order as apply_in_order.
val number_of_applicants : Selection.t -> Selection.t -> int option
number_of_applicants only except
computes how many states would be
impact by a folding. Return None
if all states are impacted.
val digest : unit -> Digest.t
Checksum of kinds of type t
.
val dump_dependencies : ?only:Selection.t ->
?except:Selection.t -> string -> unit
Dump the dependencies of kinds of type t
(or those of kinds specified
by only
and except
if any) in a file (in dot format).