aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/globnames.ml4
-rw-r--r--library/globnames.mli4
-rw-r--r--library/lib.ml2
-rw-r--r--library/lib.mli2
-rw-r--r--library/libobject.ml14
-rw-r--r--library/libobject.mli8
-rw-r--r--library/states.ml2
7 files changed, 12 insertions, 24 deletions
diff --git a/library/globnames.ml b/library/globnames.ml
index acb05f9ac0..63cb2c69bd 100644
--- a/library/globnames.ml
+++ b/library/globnames.ml
@@ -123,7 +123,3 @@ module ExtRefOrdered = struct
| SynDef kn -> combinesmall 2 (KerName.hash kn)
end
-
-type global_reference_or_constr =
- | IsGlobal of GlobRef.t
- | IsConstr of constr
diff --git a/library/globnames.mli b/library/globnames.mli
index 48cbb11b66..d61cdd2b64 100644
--- a/library/globnames.mli
+++ b/library/globnames.mli
@@ -59,7 +59,3 @@ module ExtRefOrdered : sig
val equal : t -> t -> bool
val hash : t -> int
end
-
-type global_reference_or_constr =
- | IsGlobal of GlobRef.t
- | IsConstr of constr
diff --git a/library/lib.ml b/library/lib.ml
index 9cce9b92ad..7f96adeecf 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -500,7 +500,7 @@ let close_section () =
type frozen = lib_state
-let freeze ~marshallable = !lib_state
+let freeze () = !lib_state
let unfreeze st = lib_state := st
diff --git a/library/lib.mli b/library/lib.mli
index 0d03046dc2..1fe72389f6 100644
--- a/library/lib.mli
+++ b/library/lib.mli
@@ -151,7 +151,7 @@ val close_section : unit -> unit
type frozen
-val freeze : marshallable:bool -> frozen
+val freeze : unit -> frozen
val unfreeze : frozen -> unit
(** Keep only the libobject structure, not the objects themselves *)
diff --git a/library/libobject.ml b/library/libobject.ml
index c9ea6bcff8..28d0654444 100644
--- a/library/libobject.ml
+++ b/library/libobject.ml
@@ -82,8 +82,6 @@ and objects = (Names.Id.t * t) list
and substitutive_objects = MBId.t list * algebraic_objects
-let object_tag (Dyn.Dyn (t, _)) = Dyn.repr t
-
module DynMap = Dyn.Map (struct type 'a t = 'a object_declaration end)
let cache_tab = ref DynMap.empty
@@ -92,14 +90,12 @@ let declare_object_full odecl =
let na = odecl.object_name in
let tag = Dyn.create na in
let () = cache_tab := DynMap.add tag odecl !cache_tab in
- let infun v = Dyn.Dyn (tag, v) in
- let outfun v = match Dyn.Easy.prj v tag with
- | None -> assert false
- | Some v -> v
- in
- (infun,outfun)
+ tag
-let declare_object odecl = fst (declare_object_full odecl)
+let declare_object odecl =
+ let tag = declare_object_full odecl in
+ let infun v = Dyn.Dyn (tag, v) in
+ infun
let cache_object (sp, Dyn.Dyn (tag, v)) =
let decl = DynMap.find tag !cache_tab in
diff --git a/library/libobject.mli b/library/libobject.mli
index 146ccc293f..c25345994a 100644
--- a/library/libobject.mli
+++ b/library/libobject.mli
@@ -101,7 +101,9 @@ val ident_subst_function : substitution * 'a -> 'a
will hand back two functions, the "injection" and "projection"
functions for dynamically typed library-objects. *)
-type obj
+module Dyn : Dyn.S
+
+type obj = Dyn.t
type algebraic_objects =
| Objs of objects
@@ -120,13 +122,11 @@ and objects = (Names.Id.t * t) list
and substitutive_objects = Names.MBId.t list * algebraic_objects
val declare_object_full :
- 'a object_declaration -> ('a -> obj) * (obj -> 'a)
+ 'a object_declaration -> 'a Dyn.tag
val declare_object :
'a object_declaration -> ('a -> obj)
-val object_tag : obj -> string
-
val cache_object : object_name * obj -> unit
val load_object : int -> object_name * obj -> unit
val open_object : int -> object_name * obj -> unit
diff --git a/library/states.ml b/library/states.ml
index 0be153d96a..90303a2a5c 100644
--- a/library/states.ml
+++ b/library/states.ml
@@ -18,7 +18,7 @@ let replace_summary (lib,_) st = lib, st
let replace_lib (_,st) lib = lib, st
let freeze ~marshallable =
- (Lib.freeze ~marshallable, Summary.freeze_summaries ~marshallable)
+ (Lib.freeze (), Summary.freeze_summaries ~marshallable)
let unfreeze (fl,fs) =
Lib.unfreeze fl;