-(** Sets as ordered polymorphic lists. *)

+ Sets as ordered polymorphic lists.

+ Author: S-Aébastien Ferré-b

let remove : 'a -> 'a list -> 'a list =

fun x l -> subtract l [x]

-(* partition ~~par~~ the belonging to a set *)

+(* partition by the belonging to a set *)

(* partitioner -> partitionee -> inter * diff *)

- let rec partition_set : 'a t -> 'a t -> 'a t * 'a t =

- fun l1 l2 -> match l1, l2 with

- let comp = compare x1 x2 in

- partition_set l1 (x2::l2)

- let inter, diff = partition_set (x1::l1) l2 in

- let inter, diff = partition_set l1 l2 in

+let rec partition_set : 'a t -> 'a t -> 'a t * 'a t =

+ fun l1 l2 -> match l1, l2 with

+ let comp = compare x1 x2 in

+ partition_set l1 (x2::l2)

+ let inter, diff = partition_set (x1::l1) l2 in

+ let inter, diff = partition_set l1 l2 in

(** Remove an element if present, add it otherwise. *)

let rec flip : 'a -> 'a list -> 'a list =

- iterative functions on lists can also be applied, ~~at least in some case~~s

+ iterative functions on lists can also be applied, provided they preserve the order of lists