aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/dyn.mli
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-12-04 21:46:12 +0100
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2015-12-04 21:55:31 +0100
commit153d77d00ccbacf22aa5d70ca2c1cacab2749339 (patch)
tree98997d190ad1b45f3096473c1015feae55b64efe /lib/dyn.mli
parent0aba678e885fa53fa649de59eb1d06b4af3a847c (diff)
Specializing the Dyn module to each usecase.
Actually, we never mix the various uses of each dynamic type created through the Dyn module. To enforce this statically, we functorize the Dyn module so that we recover a fresh instance at each use point.
Diffstat (limited to 'lib/dyn.mli')
-rw-r--r--lib/dyn.mli6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/dyn.mli b/lib/dyn.mli
index cac912aca..55c4f0ce8 100644
--- a/lib/dyn.mli
+++ b/lib/dyn.mli
@@ -8,6 +8,8 @@
(** Dynamics. Use with extreme care. Not for kids. *)
+module type S =
+sig
type t
val create : string -> ('a -> t) * (t -> 'a)
@@ -15,3 +17,7 @@ val tag : t -> string
val has_tag : t -> string -> bool
val pointer_equal : t -> t -> bool
val dump : unit -> (int * string) list
+end
+
+(** FIXME: use OCaml 4.02 generative functors when available *)
+module Make(M : CSig.EmptyS) : S