module Type_generic:sig
..end
type 'a computation
Examples of computation:
type sexp_of_t = ('a -> Sexp.t) computation type type_struct = Type_struct.t computation
The term generic
is used to refer to a specific implementation of a computation
whose concrete implementation is programmed using the type representation of values.
For example, when one uses with sexp
as a way to implement the sexp_of_t
computation, the technique used is code generation at compile time. Another approach
is to define a generic function sexp_of_t
that inspects the representation of the
type at runtime.
This module offers an abstraction over type rep in order to implement generics in a efficient way.
Provided from a user enough pieces of implementation regarding a particular computation, this module returns essentially the following function:
(** main function : get the computation from the typerep *)
val of_typerep : 'a Typerep.t -> `generic of 'a computation
that allows one to get the generic computation operating on a given type 'a
.
type 'a computation
Examples of computation:
type sexp_of_t = ('a -> Sexp.t) computation type type_struct = Type_struct.t computation
The term generic
is used to refer to a specific implementation of a computation
whose concrete implementation is programmed using the type representation of values.
For example, when one uses with sexp
as a way to implement the sexp_of_t
computation, the technique used is code generation at compile time. Another approach
is to define a generic function sexp_of_t
that inspects the representation of the
type at runtime.
This module offers an abstraction over type rep in order to implement generics in a efficient way.
Provided from a user enough pieces of implementation regarding a particular computation, this module returns essentially the following function:
(** main function : get the computation from the typerep *)
val of_typerep : 'a Typerep.t -> `generic of 'a computation
that allows one to get the generic computation operating on a given type 'a
.
module Variant_and_record_intf: module type of Variant_and_record_intf
module Helper:
module type Named =sig
..end
module type Computation =sig
..end
module Make_named_for_closure:functor (
X
:
sig
type
'a
inputtype
'a
outputtype'a
t ='a input ->
'a outputend
) ->
Named
with type 'a computation := 'a X.t
module Ident:sig
..end
module type S =sig
..end
module Make:functor (
X
:
sig
type
'a
tval name :string
val required :Type_generic.Ident.t list
include Type_generic.Computation
end
) ->
S
with type 'a t = 'a X.t
name
is used for debug information only in case of Broken_dependency.