Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data TypeMap x
- type family Item x t
- empty :: TypeMap x
- null :: TypeMap x -> Bool
- size :: TypeMap x -> Int
- insert :: forall t x proxy. Typeable t => proxy t -> Item x t -> TypeMap x -> TypeMap x
- update :: forall t x proxy. Typeable t => proxy t -> (Item x t -> Maybe (Item x t)) -> TypeMap x -> TypeMap x
- lookup :: forall t x proxy. Typeable t => proxy t -> TypeMap x -> Maybe (Item x t)
- delete :: forall t x proxy. Typeable t => proxy t -> TypeMap x -> TypeMap x
- union :: forall x. TypeMap x -> TypeMap x -> TypeMap x
- difference :: forall x. TypeMap x -> TypeMap x -> TypeMap x
- intersection :: forall x y. TypeMap x -> TypeMap y -> TypeMap x
- map :: forall x y. (forall t. Typeable t => Proxy t -> Item x t -> Item y t) -> TypeMap x -> TypeMap y
- traverse :: forall f x y. Applicative f => (forall t. Typeable t => Proxy t -> Item x t -> f (Item y t)) -> TypeMap x -> f (TypeMap y)
- data OfType a
Documentation
An extensible type family mapping types (as keys) to types of values,
parameterized by types x
.
insert :: forall t x proxy. Typeable t => proxy t -> Item x t -> TypeMap x -> TypeMap x Source #
Insert an element indexed by type t
.
update :: forall t x proxy. Typeable t => proxy t -> (Item x t -> Maybe (Item x t)) -> TypeMap x -> TypeMap x Source #
Update an element indexed by type t
.
lookup :: forall t x proxy. Typeable t => proxy t -> TypeMap x -> Maybe (Item x t) Source #
Lookup an element indexed by type t
.
delete :: forall t x proxy. Typeable t => proxy t -> TypeMap x -> TypeMap x Source #
Delete a key and its value from the map. Does nothing if the key does not exist.
union :: forall x. TypeMap x -> TypeMap x -> TypeMap x Source #
Left-biased union of two maps; it keeps the first key if duplicates are found.
difference :: forall x. TypeMap x -> TypeMap x -> TypeMap x Source #
Difference of two maps; keep elements of the first map which are not in the second.
intersection :: forall x y. TypeMap x -> TypeMap y -> TypeMap x Source #
Intersection of two maps; keep elements of the first map which are also in the second.
map :: forall x y. (forall t. Typeable t => Proxy t -> Item x t -> Item y t) -> TypeMap x -> TypeMap y Source #
Map a function on all elements.
traverse :: forall f x y. Applicative f => (forall t. Typeable t => Proxy t -> Item x t -> f (Item y t)) -> TypeMap x -> f (TypeMap y) Source #
Traverse the map.
A constant mapping to type a
.
is the type of
maps from types to values of type TypeMap
(OfType
a)a
.
Instances
type UnTyped (OfType a) Source # | |
Defined in Data.TypeMap.Internal.Dynamic | |
type Typed (OfType a) t Source # | |
Defined in Data.TypeMap.Internal.Dynamic | |
type Item (OfType a) t Source # | |
Defined in Data.TypeMap.Internal.Dynamic |