-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Efficient implementation of a dependent map with types as keys -- -- A dependent map from type representations to values of these types. -- -- Here is an illustration of such a map: -- --
-- TMap -- --------------- -- Int -> 5 -- Bool -> True -- Char -> 'x' ---- -- In addition to TMap, we provide TypeRepMap -- parametrized by a vinyl-style interpretation. This data -- structure is equivalent to DMap TypeRep, but with -- significantly more efficient lookups. @package typerep-map @version 0.4.0.0 -- | TypeRepMap implementation based on containers Map. module Data.TypeRep.CMap -- | Map-like data structure with types served as the keys. newtype TypeRepMap (f :: k -> Type) TypeRepMap :: Map TypeRep Any -> TypeRepMap (f :: k -> Type) [unMap] :: TypeRepMap (f :: k -> Type) -> Map TypeRep Any -- | Empty structure. empty :: TypeRepMap f -- | Inserts the value with its type as a key. insert :: forall a f. Typeable a => f a -> TypeRepMap f -> TypeRepMap f keys :: TypeRepMap f -> [TypeRep] -- | Looks up the value at the type. >>> let x = lookup $ insert -- (11 :: Int) empty >>> x :: Maybe Int Just 11 >>> x -- :: Maybe () Nothing lookup :: forall a f. Typeable a => TypeRepMap f -> Maybe (f a) size :: TypeRepMap f -> Int instance forall k (f :: k -> *). Control.DeepSeq.NFData (Data.TypeRep.CMap.TypeRepMap f) -- | TypeRepMap implementation based on the optimal Vector. module Data.TypeRep.OptimalVector data TypeRepMap (f :: k -> Type) TypeRepMap :: Vector Word64 -> Vector Word64 -> Vector Any -> TypeRepMap (f :: k -> Type) [fingerprintAs] :: TypeRepMap (f :: k -> Type) -> Vector Word64 [fingerprintBs] :: TypeRepMap (f :: k -> Type) -> Vector Word64 [anys] :: TypeRepMap (f :: k -> Type) -> Vector Any -- | Empty structure. empty :: TypeRepMap f -- | Inserts the value with its type as a key. insert :: forall a f. a -> TypeRepMap f -> TypeRepMap f -- | Looks up the value at the type. >>> let x = lookup $ insert -- (11 :: Int) empty >>> x :: Maybe Int Just 11 >>> x -- :: Maybe () Nothing lookup :: forall a f. Typeable a => TypeRepMap f -> Maybe (f a) -- | Returns the size of the TypeRepMap. size :: TypeRepMap f -> Int data TF f [TF] :: Typeable a => f a -> TF f fromList :: forall f. [TF f] -> TypeRepMap f instance forall k (f :: k -> *). Control.DeepSeq.NFData (Data.TypeRep.OptimalVector.TypeRepMap f) -- | TypeRepMap implementation based on Vector. module Data.TypeRep.Vector data TypeRepVector f TypeRepVect :: Vector Fingerprint -> Vector Any -> TypeRepVector f [fingerprints] :: TypeRepVector f -> Vector Fingerprint [anys] :: TypeRepVector f -> Vector Any data TF f [TF] :: Typeable a => f a -> TF f -- | Empty structure. empty :: TypeRepVector f -- | Inserts the value with its type as a key. insert :: forall a f. a -> TypeRepVector f -> TypeRepVector f -- | Looks up the value at the type. >>> let x = lookup $ insert -- (11 :: Int) empty >>> x :: Maybe Int Just 11 >>> x -- :: Maybe () Nothing lookup :: forall a f. Typeable a => TypeRepVector f -> Maybe (f a) -- | Returns the size of the TypeRepVect. size :: TypeRepVector f -> Int fromList :: forall f. [TF f] -> TypeRepVector f instance Data.Vector.Unboxed.Base.Unbox GHC.Fingerprint.Type.Fingerprint instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector GHC.Fingerprint.Type.Fingerprint instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector GHC.Fingerprint.Type.Fingerprint