Compiling after adding record type F · JavaDerek/unison@de1c2b2 · GitHub
Skip to content

Commit de1c2b2

Browse files
committed
Compiling after adding record type F
1 parent 6489447 commit de1c2b2

8 files changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 0 deletions

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,6 +2738,7 @@ c2sDecl saveText saveDefn (C.Decl.DataDeclaration dt m b cts) = do
27382738
C.Type.Effects es -> pure $ C.Type.Effects es
27392739
C.Type.Forall a -> pure $ C.Type.Forall a
27402740
C.Type.IntroOuter a -> pure $ C.Type.IntroOuter a
2741+
C.Type.Record fields -> pure $ C.Type.Record fields
27412742
done :: (S.Decl.Decl Symbol, (Seq Text, Seq Hash)) -> m (LocalIds' t d, S.Decl.Decl Symbol)
27422743
done (decl, (localTextValues, localDefnValues)) = do
27432744
textIds <- traverse saveText localTextValues
@@ -2807,6 +2808,7 @@ c2xTerm saveText saveDefn tm tp =
28072808
C.Type.Effects es -> pure $ C.Type.Effects es
28082809
C.Type.Forall a -> pure $ C.Type.Forall a
28092810
C.Type.IntroOuter a -> pure $ C.Type.IntroOuter a
2811+
C.Type.Record fields -> pure $ C.Type.Record fields
28102812
goCase ::
28112813
forall m w s a.
28122814
( MonadState s m,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ getType getReference = getABT getSymbol getUnit go
457457
5 -> Type.Effects <$> getList getChild
458458
6 -> Type.Forall <$> getChild
459459
7 -> Type.IntroOuter <$> getChild
460+
8 -> Type.Record . Map.fromList <$> getList (getPair getText getChild)
460461
tag -> unknownTag "getType" tag
461462
getKind :: (MonadGet m) => m Kind
462463
getKind =
@@ -1133,6 +1134,7 @@ putType putReference putVar = putABT putVar putUnit go
11331134
Type.Effects es -> putWord8 5 *> putFoldable putChild es
11341135
Type.Forall body -> putWord8 6 *> putChild body
11351136
Type.IntroOuter body -> putWord8 7 *> putChild body
1137+
Type.Record fields -> putWord8 8 *> putFoldable (\(l, t) -> putText l *> putChild t) (Map.toAscList fields)
11361138
putKind :: (MonadPut m) => Kind -> m ()
11371139
putKind k = case k of
11381140
Kind.Star -> putWord8 0

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,4 @@ unhashComponent componentHash refToVar m =
145145
Type.Effects as -> ABT.tm () $ Type.Effects as
146146
Type.Forall a -> ABT.tm () $ Type.Forall a
147147
Type.IntroOuter a -> ABT.tm () $ Type.IntroOuter a
148+
Type.Record fields -> ABT.tm () $ Type.Record fields

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ data F' r a
2727
| IntroOuter a -- binder like ∀, used to introduce variables that are
2828
-- bound by outer type signatures, to support scoped type
2929
-- variables
30+
| Record (Map Text a)
3031
deriving (Foldable, Functor, Eq, Ord, Show, Traversable)
3132

3233
-- | Non-recursive type

‎parser-typechecker/src/Unison/Codebase/SqliteCodebase/Conversions.hs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ type2to1' convertRef =
363363
V2.Type.Effects as -> V1.Type.Effects as
364364
V2.Type.Forall a -> V1.Type.Forall a
365365
V2.Type.IntroOuter a -> V1.Type.IntroOuter a
366+
V2.Type.Record fields -> V1.Type.Record fields
366367
where
367368
convertKind = \case
368369
V2.Kind.Star -> V1.Kind.Star
@@ -390,6 +391,7 @@ type1to2' convertRef =
390391
V1.Type.Effects as -> V2.Type.Effects as
391392
V1.Type.Forall a -> V2.Type.Forall a
392393
V1.Type.IntroOuter a -> V2.Type.IntroOuter a
394+
V1.Type.Record fields -> V2.Type.Record fields
393395
where
394396
convertKind = \case
395397
V1.Kind.Star -> V2.Kind.Star

‎parser-typechecker/src/Unison/Hashing/V2/Convert.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ m2hType = ABT.transform \case
282282
Memory.Type.Effects a1s -> Hashing.TypeEffects a1s
283283
Memory.Type.Forall a1 -> Hashing.TypeForall a1
284284
Memory.Type.IntroOuter a1 -> Hashing.TypeIntroOuter a1
285-
Memory.Type.Record a1 -> Hashing.Record a1
285+
Memory.Type.Record a1 -> Hashing.TypeRecord a1
286286

287287
m2hKind :: Memory.Kind.Kind -> Hashing.Kind
288288
m2hKind = \case
@@ -321,6 +321,7 @@ h2mType = ABT.transform \case
321321
Hashing.TypeEffects a1s -> Memory.Type.Effects a1s
322322
Hashing.TypeForall a1 -> Memory.Type.Forall a1
323323
Hashing.TypeIntroOuter a1 -> Memory.Type.IntroOuter a1
324+
Hashing.TypeRecord a1 -> Memory.Type.Record a1
324325

325326
h2mKind :: Hashing.Kind -> Memory.Kind.Kind
326327
h2mKind = \case

‎unison-cli/src/Unison/LSP/Queries.hs‎

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)