functor (X : OrderType) -> sig type t type elem = X.t val empty : t val pop : t -> elem * t val add : t -> elem list -> t val elements : t -> elem list val length : t -> int end