[sledge] Dedup Set signature

Reviewed By: ngorogiannis

Differential Revision: D20482769

fbshipit-source-id: a9dd43b53
master
Josh Berdine 5 years ago committed by Facebook GitHub Bot
parent 42a8f774fd
commit 5dbb4a6fc2

@ -6,48 +6,7 @@
*)
open Import0
open Vector.Infix
module type S = sig
type elt
type t
val compare : t -> t -> int
val equal : t -> t -> bool
val sexp_of_t : t -> Sexp.t
val t_of_sexp : (Sexp.t -> elt) -> Sexp.t -> t
val pp : elt pp -> t pp
val pp_diff : elt pp -> (t * t) pp
(* initial constructors *)
val empty : t
val of_ : elt -> t
val of_option : elt option -> t
val of_list : elt list -> t
val of_vector : elt vector -> t
(* constructors *)
val add : t -> elt -> t
val add_option : elt option -> t -> t
val add_list : elt list -> t -> t
val remove : t -> elt -> t
val filter : t -> f:(elt -> bool) -> t
val union : t -> t -> t
val union_list : t list -> t
val diff : t -> t -> t
val inter : t -> t -> t
val diff_inter : t -> t -> t * t
(* queries *)
val is_empty : t -> bool
val mem : t -> elt -> bool
val is_subset : t -> of_:t -> bool
val disjoint : t -> t -> bool
val max_elt : t -> elt option
(* traversals *)
val fold : t -> init:'s -> f:('s -> elt -> 's) -> 's
end
include Set_intf
module Make (Elt : OrderedType) : S with type elt = Elt.t = struct
module S = Caml.Set.Make (Elt)

@ -6,46 +6,5 @@
*)
open Import0
module type S = sig
type elt
type t
val compare : t -> t -> int
val equal : t -> t -> bool
val sexp_of_t : t -> Sexp.t
val t_of_sexp : (Sexp.t -> elt) -> Sexp.t -> t
val pp : elt pp -> t pp
val pp_diff : elt pp -> (t * t) pp
(* initial constructors *)
val empty : t
val of_ : elt -> t
val of_option : elt option -> t
val of_list : elt list -> t
val of_vector : elt Vector.t -> t
(* constructors *)
val add : t -> elt -> t
val add_option : elt option -> t -> t
val add_list : elt list -> t -> t
val remove : t -> elt -> t
val filter : t -> f:(elt -> bool) -> t
val union : t -> t -> t
val union_list : t list -> t
val diff : t -> t -> t
val inter : t -> t -> t
val diff_inter : t -> t -> t * t
(* queries *)
val is_empty : t -> bool
val mem : t -> elt -> bool
val is_subset : t -> of_:t -> bool
val disjoint : t -> t -> bool
val max_elt : t -> elt option
(* traversals *)
val fold : t -> init:'s -> f:('s -> elt -> 's) -> 's
end
include module type of Set_intf
module Make (Elt : OrderedType) : S with type elt = Elt.t

@ -0,0 +1,49 @@
(*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
open Import0
module type S = sig
type elt
type t
val compare : t -> t -> int
val equal : t -> t -> bool
val sexp_of_t : t -> Sexp.t
val t_of_sexp : (Sexp.t -> elt) -> Sexp.t -> t
val pp : elt pp -> t pp
val pp_diff : elt pp -> (t * t) pp
(* initial constructors *)
val empty : t
val of_ : elt -> t
val of_option : elt option -> t
val of_list : elt list -> t
val of_vector : elt Vector.t -> t
(* constructors *)
val add : t -> elt -> t
val add_option : elt option -> t -> t
val add_list : elt list -> t -> t
val remove : t -> elt -> t
val filter : t -> f:(elt -> bool) -> t
val union : t -> t -> t
val union_list : t list -> t
val diff : t -> t -> t
val inter : t -> t -> t
val diff_inter : t -> t -> t * t
(* queries *)
val is_empty : t -> bool
val mem : t -> elt -> bool
val is_subset : t -> of_:t -> bool
val disjoint : t -> t -> bool
val max_elt : t -> elt option
(* traversals *)
val fold : t -> init:'s -> f:('s -> elt -> 's) -> 's
end

@ -376,18 +376,13 @@ end
compute unique sort_index ids *)
module Block_label = struct
module T = struct
module T0 = struct
type t = block [@@deriving sexp_of]
type t = block [@@deriving sexp_of]
let compare x y =
[%compare: string * Global.t] (x.lbl, x.parent.name)
(y.lbl, y.parent.name)
let compare x y =
[%compare: string * Global.t] (x.lbl, x.parent.name)
(y.lbl, y.parent.name)
let hash b = [%hash: string * Global.t] (b.lbl, b.parent.name)
end
include T0
include Comparator.Make (T0)
let hash b = [%hash: string * Global.t] (b.lbl, b.parent.name)
end
include T

Loading…
Cancel
Save