Skip to content
Snippets Groups Projects
Commit 93771ae6 authored by David Bühler's avatar David Bühler
Browse files

[server] Data: fixes the signature of functors for indexed values.

These functors only require a 'kind' string.
parent a75b4445
No related branches found
No related tags found
No related merge requests found
...@@ -565,6 +565,11 @@ end ...@@ -565,6 +565,11 @@ end
(* --- Index --- *) (* --- Index --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
module type Info =
sig
val kind: string
end
(** Simplified [Map.S] *) (** Simplified [Map.S] *)
module type Map = module type Map =
sig sig
...@@ -584,7 +589,7 @@ sig ...@@ -584,7 +589,7 @@ sig
val clear : unit -> unit val clear : unit -> unit
end end
module INDEXER(M : Map)(D : S)(I : Index with type t = D.t) : module INDEXER(M : Map)(I : Info) :
sig sig
type index type index
val create : unit -> index val create : unit -> index
...@@ -634,10 +639,10 @@ struct ...@@ -634,10 +639,10 @@ struct
end end
module Static(M : Map)(S : S)(I : Index with type t = S.t) module Static(M : Map)(I : Info)
: Index with type t = M.key = : Index with type t = M.key =
struct struct
module INDEX = INDEXER(M)(S)(I) module INDEX = INDEXER(M)(I)
let kind = I.kind let kind = I.kind
let index = INDEX.create () let index = INDEX.create ()
let clear () = INDEX.clear index let clear () = INDEX.clear index
...@@ -652,10 +657,10 @@ struct ...@@ -652,10 +657,10 @@ struct
end) end)
end end
module Index(M : Map)(S : S)(I : Index with type t = S.t) module Index(M : Map)(I : Info)
: Index with type t = M.key = : Index with type t = M.key =
struct struct
module INDEX = INDEXER(M)(S)(I) module INDEX = INDEXER(M)(I)
module TYPE : Datatype.S with type t = INDEX.index = module TYPE : Datatype.S with type t = INDEX.index =
Datatype.Make Datatype.Make
(struct (struct
...@@ -695,8 +700,7 @@ sig ...@@ -695,8 +700,7 @@ sig
val id : t -> int val id : t -> int
end end
module Identified(A : IdentifiedType)(S : S) module Identified(A : IdentifiedType)(I : Info) : Index with type t = A.t =
(I : Index with type t = S.t) : Index with type t = A.t =
struct struct
type index = (int,A.t) Hashtbl.t type index = (int,A.t) Hashtbl.t
......
...@@ -323,6 +323,12 @@ end ...@@ -323,6 +323,12 @@ end
*) *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
(** Datatype information. *)
module type Info =
sig
val kind: string
end
(** Simplified [Map.S]. *) (** Simplified [Map.S]. *)
module type Map = module type Map =
sig sig
...@@ -345,12 +351,10 @@ sig ...@@ -345,12 +351,10 @@ sig
end end
(** Builds an indexer that {i does not} depend on current project. *) (** Builds an indexer that {i does not} depend on current project. *)
module Static(M : Map)(S : S) module Static(M : Map)(I : Info) : Index with type t = M.key
(I : Index with type t = S.t) : Index with type t = M.key
(** Builds a {i projectified} index. *) (** Builds a {i projectified} index. *)
module Index(M : Map)(S : S) module Index(M : Map)(I : Info) : Index with type t = M.key
(I : Index with type t = S.t) : Index with type t = M.key
(** Datatype already identified by unique integers. *) (** Datatype already identified by unique integers. *)
module type IdentifiedType = module type IdentifiedType =
...@@ -360,8 +364,7 @@ sig ...@@ -360,8 +364,7 @@ sig
end end
(** Builds a {i projectified} index on types with {i unique} identifiers. *) (** Builds a {i projectified} index on types with {i unique} identifiers. *)
module Identified(A : IdentifiedType)(S : S) module Identified(A : IdentifiedType)(I : Info) : Index with type t = A.t
(I : Index with type t = S.t) : Index with type t = A.t
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
(** {2 Error handling} (** {2 Error handling}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment