


The standard library Set api defines an interface for datastructures which implement set operations, typically via some sort of binary tree datastructure.
The Set api is implemented by the int_binary_set, int_list_set unt_red_black_set, int_red_black_set and string_set packages.
Red-black trees are the de facto standard Mythryl balanced binary tree type, hence int_red_black_set may be considered the standard tree-based integer Set implementation and string_set the standard tree-based string Set implementation.
The Set api source code is in src/lib/src/set.api.
The above information is manually maintained and may contain errors.
api { package key : api {
Key ;
compare : (Key , Key) -> Order;
};;
Item = key::Key;
Set ;
empty : Set;
singleton : Item -> Set;
add : (Set , Item) -> Set;
add' : (Item , Set) -> Set;
add_list : (Set , List(Item )) -> Set;
delete : (Set , Item) -> Set;
member : (Set , Item) -> Bool;
is_empty : Set -> Bool;
equal : (Set , Set) -> Bool;
compare : (Set , Set) -> Order;
is_subset : (Set , Set) -> Bool;
vals_count : Set -> Int;
vals_list : Set -> List(Item );
union : (Set , Set) -> Set;
intersection : (Set , Set) -> Set;
difference : (Set , Set) -> Set;
map : (Item -> Item) -> Set -> Set;
apply : (Item -> Void) -> Set -> Void;
fold_left : ((Item , X) -> X) -> X -> Set -> X;
fold_right : ((Item , X) -> X) -> X -> Set -> X;
partition : (Item -> Bool) -> Set -> (Set , Set);
filter : (Item -> Bool) -> Set -> Set;
exists : (Item -> Bool) -> Set -> Bool;
find : (Item -> Bool) -> Set -> Null_Or(Item );
all_invariants_hold : Set -> Bool;
};


