type 'a t = 'a list
let empty = []
let singleton x = [x]
let to_list x = x
let rec insert x = function
[] -> [x]
| y::rest -> if x = y then y :: rest else y :: insert x rest
let union xs ys =
List.fold_left (fun zs x -> insert x zs) ys xs
let rec remove x = function
[] -> []
| y::rest -> if x = y then rest else y :: remove x rest
let diff xs ys =
List.fold_left (fun zs x -> remove x zs) xs ys
let member = List.memq