op_union : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list
- op_union (fn x => fn y => x mod 2 = y mod 2) [1,2,3] [5,4,7]; > val it = [5, 4, 7] : int list
There is no requirement that eq be recognizable as a kind of equality (it could be implemented by an order relation, for example).
A high-performance implementation of finite sets may be found in structure HOLset.