Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.Type.Set
- data Set n where
- type Union s t = Nub (Sort (Append s t))
- type Unionable s t = (Sortable (Append s t), Nubable (Sort (Append s t)))
- union :: Unionable s t => Set s -> Set t -> Set (Union s t)
- append :: Set s -> Set t -> Set (Append s t)
- type family Sort xs :: [k]
- class Sortable xs where
- type family Append s t :: [k]
- class Split s t st where
- type family Cmp a b :: Ordering
- 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
- data k :-> v = (Var k) :-> v
- data Var k where
Documentation
Core Set definition, in terms of lists
type family Cmp a b :: Ordering Source
Open-family for the ordering operation in the sort
Instances
type Cmp * ((:->) v a) ((:->) u b) = CmpSymbol v u Source | Symbol comparison |
type Cmp (Map Name Session) ((:->) Name Session c a) ((:->) Name Session d b) = CmpSessionMap ((:->) Name Session c a) ((:->) Name Session d b) Source | Compare channel names for normalising type-level finite map representations |
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
Pair a symbol (representing a variable) with a type