aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/dyn.mli
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dyn.mli')
-rw-r--r--lib/dyn.mli13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/dyn.mli b/lib/dyn.mli
index c94fa764b..448b11a18 100644
--- a/lib/dyn.mli
+++ b/lib/dyn.mli
@@ -6,7 +6,8 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(** Dynamics. Use with extreme care. Not for kids. *)
+(** Dynamically typed values *)
+
module type TParam =
sig
type 'a t
@@ -46,6 +47,16 @@ end
val dump : unit -> (int * string) list
+module Easy : sig
+
+ (* To create a dynamic type on the fly *)
+ val make_dyn : string -> ('a -> t) * (t -> 'a)
+
+ (* For types declared with the [create] function above *)
+ val inj : 'a -> 'a tag -> t
+ val prj : t -> 'a tag -> 'a option
+end
+
end
(** FIXME: use OCaml 4.02 generative functors when available *)