Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.HashCons.Internal
Synopsis
- data HashCons a = HashConsC {
- _hashCons_hash :: !Int
- _hashCons_ref :: !(IORef a)
- pattern HashCons :: Hashable a => a -> HashCons a
- hashCons :: Hashable a => a -> HashCons a
- unHashCons :: HashCons a -> a
- compareAndSubstitute :: Eq r => (a -> a -> r) -> r -> IORef a -> IORef a -> r
Documentation
HashCons
with a precomputed hash and an IORef
to the value.
WARNING: Do not use this type to wrap types whose Eq or Ord instances allow distinguishable values to compare as equal; this will result in nondeterminism or even visible mutation of semantically-immutable values at runtime.
Constructors
HashConsC | |
Fields
|
Instances
(Read a, Hashable a) => Read (HashCons a) Source # | Read instance that parses |
Show a => Show (HashCons a) Source # | Show instance that displays |
Eq a => Eq (HashCons a) Source # | |
Ord a => Ord (HashCons a) Source # | NOTE: This instance orders by hash first, and only secondarily by
the |
Defined in Data.HashCons.Internal | |
Eq a => Hashable (HashCons a) Source # | |
Defined in Data.HashCons.Internal |
unHashCons :: HashCons a -> a Source #
Extract the value from a HashCons
.