Copyright | (c) 2017-2020 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
TypeRepMap implementation based on Vector.
Synopsis
- data TypeRepVector f = TypeRepVect {}
- data TF f where
- empty :: TypeRepVector f
- insert :: forall a f. a -> TypeRepVector f -> TypeRepVector f
- lookup :: forall a f. Typeable a => TypeRepVector f -> Maybe (f a)
- size :: TypeRepVector f -> Int
- fromList :: forall f. [TF f] -> TypeRepVector f
Documentation
data TypeRepVector f Source #
empty :: TypeRepVector f Source #
Empty structure.
insert :: forall a f. a -> TypeRepVector f -> TypeRepVector f Source #
Inserts the value with its type as a key.
lookup :: forall a f. Typeable a => TypeRepVector 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 :: TypeRepVector f -> Int Source #
Returns the size of the TypeRepVect
.
fromList :: forall f. [TF f] -> TypeRepVector f Source #