module U.Codebase.Sqlite.HashHandle
( HashHandle (..),
HashMismatch (..),
DeclHashingError (..),
)
where
import U.Codebase.Branch.Type (Branch)
import U.Codebase.BranchV3 (BranchV3)
import U.Codebase.HashTags
import U.Codebase.Reference qualified as C
import U.Codebase.Sqlite.Branch.Format (HashBranchLocalIds)
import U.Codebase.Sqlite.Branch.Full (LocalBranch)
import U.Codebase.Sqlite.Decl.Format qualified as DeclFormat
import U.Codebase.Sqlite.Patch.Format (HashPatchLocalIds)
import U.Codebase.Sqlite.Patch.Full (LocalPatch)
import U.Codebase.Sqlite.Symbol (Symbol)
import U.Codebase.Sqlite.Term.Format qualified as TermFormat
import U.Codebase.Term qualified as C.Term
import U.Codebase.Type qualified as C.Type
import Unison.Hash (Hash)
import Unison.Prelude
data HashMismatch = HashMismatch
{ HashMismatch -> Hash
expectedHash :: Hash,
HashMismatch -> Hash
actualHash :: Hash
}
data DeclHashingError
= DeclHashMismatch HashMismatch
| DeclHashResolutionFailure
data HashHandle = HashHandle
{
HashHandle -> Type Symbol -> Reference
toReference :: C.Term.Type Symbol -> C.Reference,
HashHandle -> Type Symbol -> Set Reference
toReferenceMentions :: C.Term.Type Symbol -> Set C.Reference,
HashHandle -> Hash -> TypeD Symbol -> Reference
toReferenceDecl :: Hash -> C.Type.TypeD Symbol -> C.Reference,
HashHandle -> Hash -> TypeD Symbol -> Set Reference
toReferenceDeclMentions :: Hash -> C.Type.TypeD Symbol -> Set C.Reference,
HashHandle
-> forall (m :: * -> *). Monad m => Branch m -> m BranchHash
hashBranch :: forall m. (Monad m) => Branch m -> m BranchHash,
HashHandle -> forall (m :: * -> *). BranchV3 m -> BranchHash
hashBranchV3 :: forall m. BranchV3 m -> BranchHash,
HashHandle -> BranchHash -> Set CausalHash -> CausalHash
hashCausal ::
BranchHash ->
Set CausalHash ->
CausalHash,
HashHandle -> HashBranchLocalIds -> LocalBranch -> BranchHash
hashBranchFormatFull ::
HashBranchLocalIds ->
LocalBranch ->
BranchHash,
HashHandle -> HashPatchLocalIds -> LocalPatch -> PatchHash
hashPatchFormatFull ::
HashPatchLocalIds ->
LocalPatch ->
PatchHash,
HashHandle -> ComponentHash -> HashTermFormat -> Maybe HashMismatch
verifyTermFormatHash ::
ComponentHash ->
TermFormat.HashTermFormat ->
Maybe (HashMismatch),
HashHandle
-> ComponentHash -> HashDeclFormat -> Maybe DeclHashingError
verifyDeclFormatHash ::
ComponentHash ->
DeclFormat.HashDeclFormat ->
Maybe DeclHashingError
}