Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype TypeRepMap (f :: k -> *) = TypeRepMap {}
- empty :: TypeRepMap f
- insert :: forall a f. Typeable a => f a -> TypeRepMap f -> TypeRepMap f
- keys :: TypeRepMap f -> [TypeRep]
- lookup :: forall a f. Typeable a => TypeRepMap f -> Maybe (f a)
- size :: TypeRepMap f -> Int
Documentation
newtype TypeRepMap (f :: k -> *) Source #
Map-like data structure with types served as the keys.
Instances
NFData (TypeRepMap f) Source # | |
Defined in Data.TypeRep.CMap rnf :: TypeRepMap f -> () # |
empty :: TypeRepMap f Source #
Empty structure.
insert :: forall a f. Typeable a => f a -> TypeRepMap f -> TypeRepMap f Source #
Inserts the value with its type as a key.
keys :: TypeRepMap f -> [TypeRep] Source #
lookup :: forall a f. Typeable a => TypeRepMap f -> Maybe (f a) Source #
Looks up the value at the type. >>> let x = lookup $ insert (11 :: Int) empty >>> x :: Maybe Int Just 11 >>> x :: Maybe () Nothing
size :: TypeRepMap f -> Int Source #