|Portability||GHC only (-XKitchenSink)|
|Maintainer||Brent Yorgey <firstname.lastname@example.org>|
Various utilities for the Unbound library.
- (<>) :: Monoid m => m -> m -> m
- class Foldable f => Collection f where
- unions :: (Ord a, Collection f) => [f a] -> f a
- fromList :: (Ord a, Collection f) => [a] -> f a
- filterC :: (Collection f, Ord a) => f (Maybe a) -> f a
- newtype Multiset a = Multiset (Map a Int)
Collections are foldable types that support empty, singleton, union, and map operations. The result of a free variable calculation may be any collection. Instances are provided for lists, sets, and multisets.
An empty collection. Must be the identity for
Create a singleton collection.
An associative combining operation. The
Ord constraint is in
order to accommodate sets.
Collections must be functorial. The normal
won't do because of the
Ord constraint on sets.
Lists are containers under concatenation. Lists preserve ordering and multiplicity of elements.
Sets are containers under union, which preserve only occurrence, not multiplicity or ordering.
Multisets are containers which preserve multiplicity but not ordering.