Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Node = [Int32]
- type HashTable k v = BasicHashTable k v
- data FreshAndReuse = FreshAndReuse {}
- farEmpty :: FreshAndReuse
- lensFresh :: Lens' Int32 FreshAndReuse
- lensReuse :: Lens' Int32 FreshAndReuse
- type QNameId = [NameId]
- qnameId :: QName -> QNameId
- data Dict = Dict {
- nodeD :: !(HashTable Node Int32)
- stringD :: !(HashTable String Int32)
- bstringD :: !(HashTable ByteString Int32)
- integerD :: !(HashTable Integer Int32)
- doubleD :: !(HashTable Double Int32)
- termD :: !(HashTable (Ptr Term) Int32)
- nameD :: !(HashTable NameId Int32)
- qnameD :: !(HashTable QNameId Int32)
- nodeC :: !(IORef FreshAndReuse)
- stringC :: !(IORef FreshAndReuse)
- bstringC :: !(IORef FreshAndReuse)
- integerC :: !(IORef FreshAndReuse)
- doubleC :: !(IORef FreshAndReuse)
- termC :: !(IORef FreshAndReuse)
- nameC :: !(IORef FreshAndReuse)
- qnameC :: !(IORef FreshAndReuse)
- stats :: !(HashTable String Int)
- collectStats :: Bool
- absPathD :: !(HashTable AbsolutePath Int32)
- emptyDict :: Bool -> IO Dict
- data U = Typeable a => U !a
- type Memo = HashTable (Int32, TypeRep) U
- data St = St {}
- type S a = ReaderT Dict IO a
- type R a = ExceptT TypeError (StateT St IO) a
- malformed :: R a
- class Typeable a => EmbPrj a where
- tickICode :: forall a. Typeable a => a -> S ()
- runGetState :: Get a -> ByteString -> ByteOffset -> (a, ByteString, ByteOffset)
- icodeX :: (Eq k, Hashable k) => (Dict -> HashTable k Int32) -> (Dict -> IORef FreshAndReuse) -> k -> S Int32
- icodeInteger :: Integer -> S Int32
- icodeDouble :: Double -> S Int32
- icodeString :: String -> S Int32
- icodeNode :: Node -> S Int32
- icodeMemo :: (Ord a, Hashable a) => (Dict -> HashTable a Int32) -> (Dict -> IORef FreshAndReuse) -> a -> S Int32 -> S Int32
- vcase :: forall a. EmbPrj a => (Node -> R a) -> Int32 -> R a
- class ICODE t b where
- icodeN :: forall t. ICODE t (IsBase t) => Currying (Domains t) (S Int32) => All EmbPrj (Domains t) => Int32 -> t -> Arrows (Domains t) (S Int32)
- icodeN' :: forall t. ICODE t (IsBase t) => Currying (Domains t) (S Int32) => All EmbPrj (Domains t) => t -> Arrows (Domains t) (S Int32)
- class VALU t b where
- valuN :: forall t. VALU t (IsBase t) => Currying (Constant Int32 (Domains t)) (R (CoDomain t)) => All EmbPrj (Domains t) => t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
- valueN :: forall t. VALU t (IsBase t) => All EmbPrj (CoDomain t ': Domains t) => t -> Int32 -> R (CoDomain t)
Documentation
type HashTable k v = BasicHashTable k v Source #
The type of hashtables used in this module.
A very limited amount of testing indicates that CuckooHashTable
is somewhat slower than BasicHashTable
, and that
LinearHashTable
and the hashtables from Data.Hashtable are
much slower.
data FreshAndReuse Source #
Structure providing fresh identifiers for hash map and counting hash map hits (i.e. when no fresh identifier required).
State of the the encoder.
Dict | |
|
type Memo = HashTable (Int32, TypeRep) U Source #
Univeral memo structure, to introduce sharing during decoding
State of the decoder.
St | |
|
type R a = ExceptT TypeError (StateT St IO) a Source #
Monad used by the decoder.
TCM
is not used because the associated overheads would make
decoding slower.
runGetState :: Get a -> ByteString -> ByteOffset -> (a, ByteString, ByteOffset) Source #
Data.Binary.runGetState is deprecated in favour of runGetIncremental. Reimplementing it in terms of the new function. The new Decoder type contains strict byte strings so we need to be careful not to feed the entire lazy byte string to the decoder at once.
icodeX :: (Eq k, Hashable k) => (Dict -> HashTable k Int32) -> (Dict -> IORef FreshAndReuse) -> k -> S Int32 Source #
:: (Ord a, Hashable a) | |
=> (Dict -> HashTable a Int32) | Memo structure for thing of key |
-> (Dict -> IORef FreshAndReuse) | Statistics. |
-> a | Key to the thing. |
-> S Int32 | Fallback computation to encode the thing. |
-> S Int32 | Encoded thing. |
icode
only if thing has not seen before.
class ICODE t b where Source #
icodeArgs proxy (a1, ..., an)
maps icode
over a1
, ..., an
and returns the corresponding list of Int32
.
icodeN :: forall t. ICODE t (IsBase t) => Currying (Domains t) (S Int32) => All EmbPrj (Domains t) => Int32 -> t -> Arrows (Domains t) (S Int32) Source #
icodeN tag t a1 ... an
serialises the arguments a1
, ..., an
of the
constructor t
together with a tag tag
picked to disambiguate between
different constructors.
It corresponds to icodeNode . (tag :) =<< mapM icode [a1, ..., an]
icodeN' :: forall t. ICODE t (IsBase t) => Currying (Domains t) (S Int32) => All EmbPrj (Domains t) => t -> Arrows (Domains t) (S Int32) Source #
icodeN'
is the same as icodeN
except that there is no tag