This module implements bag and set operations on ordered lists. For
the purposes of this module, a "bag" (or "multiset") is a
non-decreasing list, whereas a "set" is a strictly ascending list.
Bags are sorted lists that may contain duplicates, whereas sets are
sorted lists that do not contain duplicates.
Except for the
nub,
sort,
nubSort, and
isSorted families of functions, every function assumes that any
list arguments are sorted lists. Assuming this precondition is met,
every resulting list is also sorted.
Because
isect handles multisets correctly, it does not return
results comparable to
Data.List.intersect on them.
Thus
isect is more than just a more efficient
intersect on ordered lists. Similar statements apply to other
associations between functions this module and functions in
Data.List, such as
union and
Data.List.union.
All functions in this module are left biased. Elements that appear in
earlier arguments have priority over equal elements that appear in
later arguments, and elements that appear earlier in a single list
have priority over equal elements that appear later in that list.