Safe Haskell | Safe |
---|---|
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 :: v) (b :: v) :: v
- class Combinable t t' where
- type family Cmp (a :: k) (b :: k) :: Ordering
- class Nubable t where
- nub :: Nubable t => Map t -> Map (Nub t)
- type family Lookup (m :: [Mapping k v]) (c :: k) :: Maybe v where ...
- type family Member (c :: k) (m :: [Mapping k v]) :: Bool where ...
- type family (m :: [Mapping k v]) :\ (c :: k) :: [Mapping k v] where ...
- class Split s t st where
- split :: Split s t st => Map st -> (Map s, Map t)
- 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
- submap :: Submap s t => Map t -> Map s
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)
(KnownSymbol k, Eq (Var k), Eq v, Eq (Map s)) => Eq (Map ((:) (Mapping Symbol *) ((:->) Symbol * k v) s)) Source # | |
Eq (Map ([] (Mapping Symbol *))) Source # | |
(KnownSymbol k, Show v, Show' (Map s)) => Show (Map ((:) (Mapping Symbol *) ((:->) Symbol * k v) s)) Source # | |
Show (Map ([] (Mapping Symbol *))) Source # | |
type family Combine (a :: v) (b :: v) :: v Source #
Open type family for combining values in a map (that have the same key)
type family Cmp (a :: k) (b :: k) :: Ordering Source #
Open-family for the ordering operation in the sort
class Nubable t where Source #
Nubable ([] (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 # | |
((~) [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 # | |
type family Lookup (m :: [Mapping k v]) (c :: k) :: Maybe v where ... Source #
Lookup elements from a map
type family (m :: [Mapping k v]) :\ (c :: k) :: [Mapping k v] where ... Source #
Delete elements from a map by key
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