Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Interned.Extended.HashTableBased
Synopsis
- type Id = Int
- data Cache t = Cache {
- fresh :: !(IORef Id)
- content :: !(CuckooHashTable (Description t) t)
- freshCache :: IO (Cache t)
- cacheSize :: Cache t -> IO Int
- resetCache :: Interned t => Cache t -> IO ()
- class (Eq (Description t), Hashable (Description t)) => Interned t where
- data Description t
- type Uninterned t
- describe :: Uninterned t -> Description t
- identify :: Id -> Uninterned t -> t
- cache :: Cache t
- intern :: Interned t => Uninterned t -> t
Documentation
Tried using the BasicHashtable size function to remove need for this IORef ( see https://github.com/gregorycollins/hashtables/pull/68 ), but it was slower
Constructors
Cache | |
Fields
|
freshCache :: IO (Cache t) Source #
class (Eq (Description t), Hashable (Description t)) => Interned t where Source #
Methods
describe :: Uninterned t -> Description t Source #
identify :: Id -> Uninterned t -> t Source #
Instances
Interned Node Source # | |
Defined in Data.ECTA.Internal.ECTA.Type | |
Interned Edge Source # | |
Defined in Data.ECTA.Internal.ECTA.Type |
intern :: Interned t => Uninterned t -> t Source #