I have the following code:
module Make_Set (Elt : EQ) : SET with type elt = Elt.t = struct
type elt = Elt.t
type t = elt list
let empty = []
let rec is_element i set =
match set with [] -> false | x :: xs -> Elt.eq x i || is_element i xs
let add i set = if is_element i set then set else i :: set
end
I can't understand the SET with type elt = Elt.t, nor I can find it in the official documentation.
It surely can be found in the official documentation, but more beginner friendly is the corresponding chapter 11 of "Real World OCaml". There is a new edition of this book from 2022.
It can be read here: https://dev.realworldocaml.org/toc.html