type-map-0.1.4.0: Type-indexed maps

Safe HaskellNone
LanguageHaskell2010

Data.TypeMap.Internal.Dynamic.Alt

Contents

Synopsis

Documentation

insert :: forall t x. Typeable t => Item x t -> TypeMap x -> TypeMap x Source #

Insert an element indexed by type t.

(<:) :: forall t x proxy. Typeable t => TypeMap x -> (proxy t, Item x t) -> TypeMap x Source #

Infix version of insert to facilitate a literal-ish syntax:

empty
  <: at t1 v1
  <: at t2 v2

at :: forall t a. Typeable t => a -> (Proxy t, a) Source #

See (<:).

update :: forall t x. Typeable t => (Item x t -> Maybe (Item x t)) -> TypeMap x -> TypeMap x Source #

Update an element indexed by type t.

lookup :: forall t x. Typeable t => TypeMap x -> Maybe (Item x t) Source #

Lookup an element indexed by type t.

delete :: forall t x. Typeable t => TypeMap x -> TypeMap x Source #

Delete a key and its value from the map. Does nothing if the key does not exist.

map :: forall x y. (forall t. Typeable 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 => Item x t -> f (Item y t)) -> TypeMap x -> f (TypeMap y) Source #

Traverse the type map. (map with effects.)

Unsafe internals

newtype Typed_ x t Source #

Constructors

Typed_ (Typed x t) 

withTypeRep :: forall x. (forall t. Typeable t => Typed_ x t) -> TypeRep -> UnTyped x Source #