Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Mapping k v = k :-> v
- type Union m n = Nub (Sort (m :++ n))
- type Unionable s t = (Nubable (Sort (s :++ t)), Sortable (s :++ t))
- union :: Unionable s t => Map s -> Map t -> Map (Union s t)
- data Var k = Var
- data Map n where
- type family Combine a b :: v
- class Combinable t t' where
- type family Cmp a b :: Ordering
- class Nubable t where
- type family Lookup m c :: Maybe v
- type family Member c m :: Bool
- type family m :\ c :: [Mapping k v]
- class Split s t st where
- type IsMap s = s ~ Nub (Sort s)
- type AsMap s = Nub (Sort s)
- asMap :: (Sortable s, Nubable (Sort s)) => Map s -> Map (AsMap s)
- class Submap s t where
Documentation
A key-value pair
k :-> v infixr 4 |
Pair a symbol (representing a variable) with a type
KnownSymbol k => Show (Var k) Source |
A value-level heterogenously-typed Map (with type-level representation in terms of lists)
type family Combine a b :: v Source
Open type family for combining values in a map (that have the same key)
class Combinable t t' where Source
Nubable ([] (Mapping Symbol *)) Source | |
((~) [Mapping Symbol *] (Nub Symbol * ((:) (Mapping Symbol *) e ((:) (Mapping Symbol *) f s))) ((:) (Mapping Symbol *) e (Nub Symbol * ((:) (Mapping Symbol *) f s))), Nubable ((:) (Mapping Symbol *) f s)) => Nubable ((:) (Mapping Symbol *) e ((:) (Mapping Symbol *) f s)) Source | |
Nubable ((:) (Mapping Symbol *) e ([] (Mapping Symbol *))) Source | |
(Combinable v v', Nubable ((:) (Mapping Symbol *) ((:->) Symbol * k (Combine * v v')) s)) => Nubable ((:) (Mapping Symbol *) ((:->) Symbol * k v) ((:) (Mapping Symbol *) ((:->) Symbol * k v') s)) Source |
class Split s t st where Source
Splitting a union of maps, given the maps we want to split it into
Split s t st => Split s ((:) (Mapping Symbol *) x t) ((:) (Mapping Symbol *) x st) Source | |
Split ([] (Mapping Symbol *)) ([] (Mapping Symbol *)) ([] (Mapping Symbol *)) Source | |
Split s t st => Split ((:) (Mapping Symbol *) x s) t ((:) (Mapping Symbol *) x st) Source | |
Split s t st => Split ((:) (Mapping Symbol *) x s) ((:) (Mapping Symbol *) x t) ((:) (Mapping Symbol *) x st) Source |
asMap :: (Sortable s, Nubable (Sort s)) => Map s -> Map (AsMap s) Source
At the value level, noramlise the list form to the map form
Construct a submap s
from a supermap t