-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Efficient hash-consing for arbitrary data types -- -- Efficient hash-consing for arbitrary data types @package intern @version 0.2.0 module Data.Interned.Internal class (Eq (Description t), Hashable (Description t)) => Interned t where { data family Description t; type family Uninterned t; } describe :: Interned t => Uninterned t -> Description t identify :: Interned t => Id t -> Uninterned t -> t identity :: Interned t => t -> Id t cache :: Interned t => Cache t class Interned t => Uninternable t unintern :: Uninternable t => t -> Uninterned t mkCache :: Cache t newtype Cache t Cache :: MVar (CacheState t) -> Cache t getCache :: Cache t -> MVar (CacheState t) data CacheState t CacheState :: {-# UNPACK #-} !Id t -> !HashMap (Description t) (Weak t) -> CacheState t newtype Id t Id :: Int -> Id t intern :: Interned t => Uninterned t -> t instance Eq (Id t) instance Ord (Id t) instance Show (Id t) instance Num (Id t) instance Real (Id t) instance Integral (Id t) instance Enum (Id t) instance Hashable (Id t) module Data.Interned class (Eq (Description t), Hashable (Description t)) => Interned t where { data family Description t; type family Uninterned t; } describe :: Interned t => Uninterned t -> Description t identify :: Interned t => Id t -> Uninterned t -> t identity :: Interned t => t -> Id t cache :: Interned t => Cache t class Interned t => Uninternable t unintern :: Uninternable t => t -> Uninterned t mkCache :: Cache t data Cache t newtype Id t Id :: Int -> Id t intern :: Interned t => Uninterned t -> t module Data.ByteString.Interned data InternedByteString InternedByteString :: {-# UNPACK #-} !Id InternedByteString -> {-# UNPACK #-} !ByteString -> InternedByteString instance Eq (Description InternedByteString) instance Hashable (Description InternedByteString) instance Uninternable InternedByteString instance Interned InternedByteString instance Show InternedByteString instance Ord InternedByteString instance Eq InternedByteString instance IsString InternedByteString module Data.String.Interned data InternedString IS :: {-# UNPACK #-} !Id InternedString -> String -> InternedString instance Eq (Description InternedString) instance Hashable (Description InternedString) instance Uninternable InternedString instance Interned InternedString instance Show InternedString instance Ord InternedString instance Eq InternedString instance IsString InternedString