unison-runtime-0.0.0
Safe HaskellNone
LanguageHaskell2010

Unison.Runtime.ANF.Serialize

Synopsis

Documentation

data Version Source #

Constructors

Transfer Word32 
Hash Word32 

Instances

Instances details
Show Version Source # 
Instance details

Defined in Unison.Runtime.ANF.Serialize

index :: Eq v => [v] -> v -> Maybe Word64 Source #

deindex :: HasCallStack => [v] -> Word64 -> v Source #

pushCtx :: [v] -> [v] -> [v] Source #

getIndex :: forall (m :: Type -> Type). PrimBase m => Get m Word64 Source #

putVar :: Eq v => [v] -> v -> Builder Source #

getVar :: forall (m :: Type -> Type) v. PrimBase m => [v] -> Get m v Source #

putArgs :: Eq v => [v] -> [v] -> Builder Source #

getArgs :: forall (m :: Type -> Type) v. PrimBase m => [v] -> Get m [v] Source #

getCCs :: forall (m :: Type -> Type). PrimBase m => Get m [Mem] Source #

getGroup :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => GDeserial m (SuperGroup Reference v) Source #

getCode :: forall (m :: Type -> Type). PrimBase m => GDeserial m (Code Reference) Source #

getInlineInfo :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => [v] -> Word64 -> GDeserial m (InlineInfo Reference v) Source #

getInlineExpr :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => [v] -> Word64 -> GDeserial m (ANormal Reference v) Source #

getOptInfos :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => Get m (OptInfos Reference v) Source #

getInlineClass :: forall (m :: Type -> Type). PrimBase m => Get m InlineClass Source #

getFresh :: Var v => Word64 -> v Source #

getComb :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => [v] -> Word64 -> GDeserial m (SuperNormal Reference v) Source #

getNormal :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => [v] -> Word64 -> GDeserial m (ANormal Reference v) Source #

getFunc :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => [v] -> GDeserial m (Func Reference v) Source #

getFOp :: forall (m :: Type -> Type). PrimBase m => Get m ForeignFunc Source #

getPOp :: forall (m :: Type -> Type). PrimBase m => Get m POp Source #

getLit :: forall (m :: Type -> Type). PrimBase m => Get m (Lit Reference) Source #

getBLit :: forall (m :: Type -> Type). PrimBase m => GDeserial m (BLit Reference) Source #

getRefs :: forall (m :: Type -> Type). PrimBase m => Get m [Reference] Source #

getBranches :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => [v] -> Word64 -> GDeserial m (Branched Reference (ANormal Reference v)) Source #

getCase :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => [v] -> Word64 -> GDeserial m ([Mem], ANormal Reference v) Source #

getCTag :: forall (m :: Type -> Type). PrimBase m => Get m CTag Source #

getGroupRef :: forall (m :: Type -> Type). PrimBase m => Get m (GroupRef Reference) Source #

getValue :: forall (m :: Type -> Type). PrimBase m => GDeserial m (Value Reference) Source #

getCont :: forall (m :: Type -> Type). PrimBase m => GDeserial m (Cont Reference) Source #

serializeGroupForRehash :: Var v => Reference -> SuperGroup Reference 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.

getGroupCurrent :: forall (m :: Type -> Type) v. (PrimBase m, Var v) => Get m (SuperGroup Reference v) Source #

type GDeserial (m :: Type -> Type) a = (Version, Bool) -> Get m a Source #

type DeserialIO a = (Version, Bool) -> Get IO a Source #

type DeserialST s a = (Version, Bool) -> Get (ST s) a Source #