Safe Haskell | Safe |
---|---|
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)
- quicksort :: Sortable xs => Set xs -> Set (Sort xs)
- append :: Set s -> Set t -> Set (s :++ t)
- type family Sort (xs :: [k]) :: [k] where ...
- class Sortable xs where
- type family (x :: [k]) :++ (y :: [k]) :: [k] where ...
- class Split s t st where
- type family Cmp (a :: k) (b :: k) :: Ordering
- type family Filter (f :: Flag) (p :: k) (xs :: [k]) :: [k] where ...
- data Flag
- type family Nub t where ...
- 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 where ...
- data Proxy p = Proxy
Documentation
type family Sort (xs :: [k]) :: [k] where ... Source #
Type-level quick sort for normalising the representation of sets
type family (x :: [k]) :++ (y :: [k]) :: [k] where ... Source #
List append (essentially set disjoint union)
type family Cmp (a :: k) (b :: k) :: Ordering Source #
Open-family for the ordering operation in the sort
class Nubable t where Source #
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