Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Version
- data TmTag
- data FnTag
- data MtTag
- data LtTag
- data BLTag
- data VaTag
- data CoTag
- index :: Eq v => [v] -> v -> Maybe Word64
- deindex :: HasCallStack => [v] -> Word64 -> v
- pushCtx :: [v] -> [v] -> [v]
- putIndex :: MonadPut m => Word64 -> m ()
- getIndex :: MonadGet m => m Word64
- putVar :: MonadPut m => Eq v => [v] -> v -> m ()
- getVar :: MonadGet m => [v] -> m v
- putArgs :: MonadPut m => Eq v => [v] -> [v] -> m ()
- getArgs :: MonadGet m => [v] -> m [v]
- putCCs :: MonadPut m => [Mem] -> m ()
- getCCs :: MonadGet m => m [Mem]
- putGroup :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> SuperGroup v -> m ()
- getGroup :: MonadGet m => Var v => m (SuperGroup v)
- putCode :: MonadPut m => Map ForeignFunc Text -> Code -> m ()
- getCode :: MonadGet m => Word32 -> m Code
- putCacheability :: MonadPut m => Cacheability -> m ()
- getCacheability :: MonadGet m => m Cacheability
- putComb :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> SuperNormal v -> m ()
- getFresh :: Var v => Word64 -> v
- getComb :: MonadGet m => Var v => [v] -> Word64 -> m (SuperNormal v)
- putNormal :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> ANormal v -> m ()
- getNormal :: MonadGet m => Var v => [v] -> Word64 -> m (ANormal v)
- putFunc :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> Func v -> m ()
- getFunc :: MonadGet m => Var v => [v] -> m (Func v)
- putPOp :: MonadPut m => POp -> m ()
- getPOp :: MonadGet m => m POp
- pOpCode :: POp -> Word16
- pOpAssoc :: [(POp, Word16)]
- pop2word :: Map POp Word16
- word2pop :: Map Word16 POp
- putLit :: MonadPut m => Lit -> m ()
- getLit :: MonadGet m => m Lit
- putBLit :: MonadPut m => Version -> BLit -> m ()
- getBLit :: MonadGet m => Version -> m BLit
- putRefs :: MonadPut m => [Reference] -> m ()
- getRefs :: MonadGet m => m [Reference]
- putBranches :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> Branched (ANormal v) -> m ()
- getBranches :: MonadGet m => Var v => [v] -> Word64 -> m (Branched (ANormal v))
- putCase :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> ([Mem], ANormal v) -> m ()
- getCase :: MonadGet m => Var v => [v] -> Word64 -> m ([Mem], ANormal v)
- putCTag :: MonadPut m => CTag -> m ()
- getCTag :: MonadGet m => m CTag
- putGroupRef :: MonadPut m => GroupRef -> m ()
- getGroupRef :: MonadGet m => m GroupRef
- putValue :: MonadPut m => Version -> Value -> m ()
- getValue :: MonadGet m => Version -> m Value
- putCont :: MonadPut m => Version -> Cont -> m ()
- getCont :: MonadGet m => Version -> m Cont
- deserializeCode :: ByteString -> Either String Code
- serializeCode :: Map ForeignFunc Text -> Code -> ByteString
- serializeGroupForRehash :: Var v => Map ForeignFunc Text -> Reference -> SuperGroup v -> ByteString
- getVersionedValue :: MonadGet m => m Value
- deserializeValue :: ByteString -> Either String Value
- serializeValue :: Value -> ByteString
- serializeValueForHash :: Value -> ByteString
- valueVersion :: Word32
- codeVersion :: Word32
Documentation
deindex :: HasCallStack => [v] -> Word64 -> v Source #
putGroup :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> SuperGroup v -> m () Source #
putCacheability :: MonadPut m => Cacheability -> m () Source #
getCacheability :: MonadGet m => m Cacheability Source #
putComb :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> SuperNormal v -> m () Source #
putNormal :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> ANormal v -> m () Source #
putFunc :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> Func v -> m () Source #
putBranches :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> Branched (ANormal v) -> m () Source #
putCase :: MonadPut m => Var v => Map Reference Word64 -> Map ForeignFunc Text -> [v] -> ([Mem], ANormal v) -> m () Source #
putGroupRef :: MonadPut m => GroupRef -> m () Source #
getGroupRef :: MonadGet m => m GroupRef Source #
deserializeCode :: ByteString -> Either String Code Source #
serializeCode :: Map ForeignFunc Text -> Code -> ByteString Source #
serializeGroupForRehash :: Var v => Map ForeignFunc Text -> Reference -> SuperGroup v -> ByteString Source #
Serializes a SuperGroup
for rehashing.
Expected as arguments are some code, and the Reference
that
refers to it. In particular, if the code refers to itself by
reference, or if the code is part of a mututally-recursive set of
definitions (which have a common hash), the reference used as part
of that (mutual) recursion must be supplied.
Using that reference, we find all references in the code to that
connected component. In the resulting byte string, those references
are instead replaced by positions in a listing of the connected
component. This means that the byte string is independent of the
hash used for the self reference. Only the order matters (which is
determined by the Reference
). Then the bytes can be re-hashed to
establish a new hash for the connected component. This operation
should be idempotent as long as the indexing is preserved.
Supplying a Builtin
reference is not supported. Such code
shouldn't be subject to rehashing.
getVersionedValue :: MonadGet m => m Value Source #
serializeValue :: Value -> ByteString Source #
codeVersion :: Word32 Source #