Commit 943020b3 authored by Yann Régis-Gianas's avatar Yann Régis-Gianas

Keyword: Simplify the definition of KeywordSet.

Action: Use [Set.of_list].
parent 01055854
......@@ -14,7 +14,7 @@ let from_stretch s =
{
expr = IL.ETextual s;
filenames = [ s.Stretch.stretch_filename ];
keywords = Keyword.KeywordSet.from_list (List.map Positions.value s.Stretch.stretch_keywords);
keywords = Keyword.KeywordSet.of_list (List.map Positions.value s.Stretch.stretch_keywords);
pkeywords = s.Stretch.stretch_keywords;
}
......
......@@ -66,16 +66,9 @@ let posvar s w f =
(* ------------------------------------------------------------------------- *)
(* Sets of keywords. *)
module KeywordSet =
struct
include Set.Make (struct
type t = keyword
let compare = compare
end)
(* This converts a list of keywords with positions into a set of keywords. *)
let from_list keywords =
List.fold_right add keywords empty
end
module KeywordSet =
Set.Make (struct
type t = keyword
let compare = compare
end)
......@@ -39,12 +39,5 @@ type keyword =
val posvar: subject -> where -> flavor -> string
(* Sets of keywords. *)
module KeywordSet :
sig
include Set.S
(* This converts a list of keywords with positions into a set of keywords. *)
val from_list: elt list -> t
end with type elt = keyword
module KeywordSet : Set.S with type elt = keyword
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment