I have the following code to create a StringSet module in base
:
open Base
type t = Set.M(String).t
let empty = Set.empty (module String)
let of_list = Set.of_list (module String)
let diff = Set.diff
let inter = Set.inter
let to_list = Set.to_list
let union = Set.union
let union_list = Set.union_list (module String)
which works, but I feel like I shouldn’t have to be explicitly reexporting every function from Set that I want in my interface. With core
it was simply
open Core
module S = Set.Make(String)
include S