Skip to content

Instantly share code, notes, and snippets.

@Gbury
Last active May 31, 2020 21:16
Show Gist options
  • Save Gbury/9eae3a590d2e73ce6a77f595cf293a49 to your computer and use it in GitHub Desktop.
Save Gbury/9eae3a590d2e73ce6a77f595cf293a49 to your computer and use it in GitHub Desktop.
type t = {
name : string;
tags : Tag.S.t;
}
let mk name tags = { name; tags; }
let tags t = t.tags
type t
(** the type of events *)
val mk : string -> Tag.S.t -> t
(** create a new event. *)
val tags : t -> Tag.S.t
(** Return the set of tags for the event. *)
(* check whether the event has at least one of the tags in tag_set *)
let is_interested tag_set event =
not (Tag.S.is_empty (Tag.S.inter tag_set (Event.tags event)))
type t = string
let print fmt t =
Format.fprintf fmt "%s" t
let hash x = Hashtbl.hash x
let compare = String.compare
let equal x y = compare x y = 0
end
(* use S here instead of Set to avoid potential name clashed *)
module S = Set.Make(struct
type nonrec t = t
let compare = compare
end)
type t
(** Type for tags *)
val print : Format.formatter -> t -> unit
val hash : t -> int
val equal : t -> t -> bool
val compare : t -> t -> int
module S : Set.S with type elt = t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment