diff options
Diffstat (limited to 'clib/dyn.mli')
-rw-r--r-- | clib/dyn.mli | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/clib/dyn.mli b/clib/dyn.mli index 51d309142..7077e1d32 100644 --- a/clib/dyn.mli +++ b/clib/dyn.mli @@ -26,43 +26,38 @@ sig val find : 'a key -> t -> 'a obj val mem : 'a key -> t -> bool - type any = Any : 'a key * 'a obj -> any - type map = { map : 'a. 'a key -> 'a obj -> 'a obj } val map : map -> t -> t + type any = Any : 'a key * 'a obj -> any val iter : (any -> unit) -> t -> unit val fold : (any -> 'r -> 'r) -> t -> 'r -> 'r end module type S = sig -type 'a tag -type t = Dyn : 'a tag * 'a -> t - -val create : string -> 'a tag -val eq : 'a tag -> 'b tag -> ('a, 'b) CSig.eq option -val repr : 'a tag -> string + type 'a tag + type t = Dyn : 'a tag * 'a -> t + val create : string -> 'a tag + val eq : 'a tag -> 'b tag -> ('a, 'b) CSig.eq option + val repr : 'a tag -> string -type any = Any : 'a tag -> any + val dump : unit -> (int * string) list -val name : string -> any option + type any = Any : 'a tag -> any + val name : string -> any option -module Map(M : TParam) : MapS with type 'a obj = 'a M.t with type 'a key = 'a tag + module Map(M : TParam) : MapS with type 'a obj = 'a M.t with type 'a key = 'a tag -val dump : unit -> (int * string) list - -module Easy : sig - - (* To create a dynamic type on the fly *) - val make_dyn_tag : string -> ('a -> t) * (t -> 'a) * 'a tag - 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 + module Easy : sig + (* To create a dynamic type on the fly *) + val make_dyn_tag : string -> ('a -> t) * (t -> 'a) * 'a tag + 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 module Make () : S |