rename decls to types · JavaDerek/unison@1cffaa6 · GitHub
Skip to content

Commit 1cffaa6

Browse files
rename decls to types
1 parent 28249ce commit 1cffaa6

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎codebase2/codebase-sqlite-hashing-v2/src/Unison/Hashing/V2/Convert2.hs‎

Lines changed: 2 additions & 2 deletions

‎codebase2/codebase-sqlite/U/Codebase/Sqlite/Branch/Full.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ data Branch' t h p c = Branch
5454
-- | A V3 branch; see U.Codebase.BranchV3
5555
data GBranchV3 t h c = BranchV3
5656
{ children :: !(Map t c),
57-
decls :: !(Map t (TypeReference' t h)),
58-
terms :: !(Map t (Referent'' t h))
57+
terms :: !(Map t (Referent'' t h)),
58+
types :: !(Map t (TypeReference' t h))
5959
}
6060
deriving stock (Generic, Show)
6161

‎codebase2/codebase-sqlite/U/Codebase/Sqlite/Operations.hs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,9 @@ saveNamespace hh bhId me = do
716716
pure (DbBranchV2 S.Branch {terms, types, patches, children})
717717
BranchV3 branch -> do
718718
children <- Map.bitraverse saveNameSegment (saveBranchV3 hh) (branch ^. #children)
719-
decls <- Map.bitraverse saveNameSegment c2sReference (branch ^. #decls)
720719
terms <- Map.bitraverse saveNameSegment c2sReferent (branch ^. #terms)
721-
pure (DbBranchV3 S.BranchV3 {children, decls, terms})
720+
types <- Map.bitraverse saveNameSegment c2sReference (branch ^. #types)
721+
pure (DbBranchV3 S.BranchV3 {children, terms, types})
722722

723723
c2sMetadata :: Transaction C.Branch.MdValues -> Transaction S.Branch.Full.DbMetadataSet
724724
c2sMetadata mm = do
@@ -942,13 +942,13 @@ saveDbBranchUnderHashId hh bhId@(Db.unBranchHashId -> hashId) stats = \case
942942
DbBranchV2 branch -> saveV2 branch
943943
-- Here, we elect to serialize V3 branches as V2 branches just before saving them to the database. We could save a
944944
-- little space instead by actually having a proper serialization format for V3 branches.
945-
DbBranchV3 branch ->
945+
DbBranchV3 S.BranchV3 {children, terms, types} ->
946946
saveV2
947947
S.Branch
948-
{ children = branch ^. #children,
948+
{ children,
949949
patches = Map.empty,
950-
terms = Map.map unconflictedAndWithoutMetadata (branch ^. #terms),
951-
types = Map.map unconflictedAndWithoutMetadata (branch ^. #decls)
950+
terms = Map.map unconflictedAndWithoutMetadata terms,
951+
types = Map.map unconflictedAndWithoutMetadata types
952952
}
953953
where
954954
-- Carry a v3 term or type (one ref, no metadata) to a v2 term or type (set of refs, each with metadata)
@@ -1435,11 +1435,11 @@ namespaceStatsForDbBranch = \case
14351435
}
14361436
childrenStats <- getChildrenStats children
14371437
pure (myStats <> childrenStats)
1438-
DbBranchV3 S.BranchV3 {children, decls, terms} -> do
1438+
DbBranchV3 S.BranchV3 {children, terms, types} -> do
14391439
let myStats =
14401440
NamespaceStats
14411441
{ numContainedTerms = Map.size terms,
1442-
numContainedTypes = Map.size decls,
1442+
numContainedTypes = Map.size types,
14431443
numContainedPatches = 0
14441444
}
14451445
childrenStats <- getChildrenStats children

‎codebase2/codebase/U/Codebase/BranchV3.hs‎

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)