Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Set n where
- type Union s t = Nub (Sort (s :++ t))
- type Unionable s t = (Sortable (s :++ t), Nubable (Sort (s :++ t)))
- union :: Unionable s t => Set s -> Set t -> Set (Union s t)
- append :: Set s -> Set t -> Set (s :++ t)
- type family Sort xs :: [k]
- class Sortable xs where
- type family x :++ y :: [k]
- class Split s t st where
- type family Cmp a b :: Ordering
- type family Filter f p xs :: [k]
- data Flag
- type family Nub t
- class Nubable t where
- type AsSet s = Nub (Sort s)
- asSet :: (Sortable s, Nubable (Sort s)) => Set s -> Set (AsSet s)
- type IsSet s = s ~ Nub (Sort s)
- class Subset s t where
- type family Delete elem set
- data Proxy p = Proxy
Documentation
Remove duplicates from a sorted list
Value-level counterpart to the type-level Nub
Note: the value-level case for equal types is not define here,
but should be given per-application, e.g., custom merging
behaviour may be required
asSet :: (Sortable s, Nubable (Sort s)) => Set s -> Set (AsSet s) Source
At the value level, noramlise the list form to the set form
Construct a subsetset s
from a superset t