module U.Codebase.Causal.Hashing where import Data.Set import Data.Set qualified as Set import U.Codebase.HashTags (BranchHash (..), CausalHash (..)) import Unison.Hashing.V2 qualified as Hashing hashCausal :: BranchHash -> Set CausalHash -> CausalHash hashCausal :: BranchHash -> Set CausalHash -> CausalHash hashCausal BranchHash branchHash Set CausalHash ancestors = Hash -> CausalHash CausalHash (Hash -> CausalHash) -> (Causal -> Hash) -> Causal -> CausalHash forall b c a. (b -> c) -> (a -> b) -> a -> c . Causal -> Hash forall a. ContentAddressable a => a -> Hash Hashing.contentHash (Causal -> CausalHash) -> Causal -> CausalHash forall a b. (a -> b) -> a -> b $ Hashing.Causal { branchHash :: Hash Hashing.branchHash = BranchHash -> Hash unBranchHash BranchHash branchHash, parents :: Set Hash Hashing.parents = (CausalHash -> Hash) -> Set CausalHash -> Set Hash forall b a. Ord b => (a -> b) -> Set a -> Set b Set.map CausalHash -> Hash unCausalHash Set CausalHash ancestors }