Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.TypeRep.OptimalVector
Synopsis
- data TypeRepMap (f :: k -> Type) = TypeRepMap {
- fingerprintAs :: Vector Word64
- fingerprintBs :: Vector Word64
- anys :: Vector Any
- empty :: TypeRepMap f
- insert :: forall a f. Typeable a => a -> TypeRepMap f -> TypeRepMap f
- lookup :: forall a f. Typeable a => TypeRepMap f -> Maybe (f a)
- size :: TypeRepMap f -> Int
- data TF f where
- fromList :: forall f. [TF f] -> TypeRepMap f
Map type
data TypeRepMap (f :: k -> Type) #
Constructors
TypeRepMap | |
Fields
|
Instances
NFData (TypeRepMap f) # | |
Defined in Data.TypeRep.OptimalVector Methods rnf :: TypeRepMap f -> () |
empty :: TypeRepMap f #
Empty structure.
insert :: forall a f. Typeable a => a -> TypeRepMap f -> TypeRepMap f #
Inserts the value with its type as a key.
lookup :: forall a f. Typeable a => TypeRepMap f -> Maybe (f a) #
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 #
Returns the size of the TypeRepMap
.
Helpful testing functions
fromList :: forall f. [TF f] -> TypeRepMap f #