Data.Set

lib/Data/Set.gob

No module comment.

type Set a
fun new : fun() -> Set a
fun fromIterator : [Iterator c, Item c ~ a, Hash a] fun(c) -> Set a

Returns a set of the elements of xs, in the order they first appear.

fun add : [Hash a] fun(Set a, a) -> Unit
fun remove : [Hash a] fun(Set a, a) -> Bool

Returns True if the element was present.

fun contains : [Hash a] fun(Set a, a) -> Bool
fun isEmpty : fun(Set a) -> Bool
fun elements : fun(Set a) -> Array a

Insertion-ordered.

fun union : [Hash a] fun(Set a, Set a) -> Set a

Returns the elements in a or b: a's in order, then those of b not in a.

fun intersection : [Hash a] fun(Set a, Set a) -> Set a

Returns the elements in both a and b, in the order of the smaller of the two, or of a when they are the same size. Costs a probe per element of the smaller set.

fun difference : [Hash a] fun(Set a, Set a) -> Set a

Returns the elements in a and not in b, in a's order.

fun symmetricDifference : [Hash a] fun(Set a, Set a) -> Set a

Returns the elements in exactly one of a and b: those of a in order, then those of b.

fun unionInto : [Hash a] fun(Set a, Set a) -> Bool

Adds every element of from to into, and returns True if that added any. Costs a probe per element of from, where into = into | from would copy both sets.

fun isSubset : [Hash a] fun(Set a, Set a) -> Bool

Returns True if every element of a is in b.

fun isDisjoint : [Hash a] fun(Set a, Set a) -> Bool

Returns True if no element is in both a and b.

instance Eq (Set a) : Hash a

Equal when they hold the same elements, whatever order they were added in.

instance Semigroup (Set a) : Hash a
instance Monoid (Set a) : Hash a
instance BitOr (Set a) : Hash a

The operators of set algebra: | union, & intersection, ^ symmetric difference and - difference, as for the bits of an Int.

instance BitAnd (Set a) : Hash a
instance BitXor (Set a) : Hash a
instance Sub (Set a) : Hash a
instance Length (Set a)
instance Iterator (Set a)
instance Debug (Set a) : Debug a

Its elements in the order they were first added, {x, ...}.

instance Show (Set a) : Debug a

What its Debug prints: a container's text shows its elements' Debug, so that a string in it is quoted.