Generic |
Main module for using the library.
|
Generic_util |
Namespace of utility modules.
|
Generic_core |
Namespace of core modules for the generic library.
|
Generic_view |
Namespace for modules defining generic views.
|
Generic_fun |
Namespace for modules defining generic functions.
|
Generic
is meant to be used as a single entry
point for using the library. It re-export the content of all
the other namespaces.
Generic_util
, Generic_core
,
Generic_view
and Generic_fun
.
Generic_util
namespace contains some definitions that where
needed by the Core
namespace but were too general to belong
there.
Generic_core
contain all of the definitions required
for generic programming: type expression are reflected in
the Generic_core.Ty.t
type, we call such values type witnesses.
The structure of types is captured by the datatype
Generic_core.Desc.t
. The type-indexed function Generic_core.Desc_fun.view
computes the structure associated with each type. It is the
most low-level view of OCaml types. Higher-level views are
derived from this one.
Extensible
and Consumer
implement a mechanism
for creating and extending type indexed functions. This
enables us to define ad-hoc polymorphic functions.
Generic_view
define high-level generic views on
types. A view is a uniform representation of the structure of
types on which generic functions can be defined.
Generic_fun
contain generic functions. They are
defined by induction on the structure of types given by a
generic view.
reify
which derives the boilerplate that is
necessary to add generic support for a user type.
import
which provides a mechanism for importing a set of
names from a module.