Skip to content

Commit

Permalink
fix: stable kind cache when AddConField
Browse files Browse the repository at this point in the history
  • Loading branch information
brprice committed Jun 2, 2023
1 parent 1631114 commit c2b3cae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions primer/src/Primer/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ import Primer.Core (
_exprMeta,
_exprMetaLens,
_type,
_typeMetaLens,
_typeMetaLens, Kind (KType),
)
import Primer.Core.DSL (S, create, emptyHole, tEmptyHole)
import Primer.Core.DSL qualified as DSL
Expand Down Expand Up @@ -839,16 +839,18 @@ applyProgAction prog mdefName = \case
$ Nothing
)
where
updateType =
alterTypeDef
updateType =
let new' = runReaderT (liftError (ActionError . TypeError) $ fmap TC.typeTtoType $ TC.checkKind KType =<< generateTypeIDs new)
(progCxt prog)
in alterTypeDef
( traverseOf #astTypeDefConstructors $
maybe (throwError $ ConNotFound con) pure
<=< findAndAdjustA
((== con) . valConName)
( traverseOf
#valConArgs
( maybe (throwError $ IndexOutOfRange index) pure
<=< liftA2 (insertAt index) (generateTypeIDs new) . pure
<=< liftA2 (insertAt index) new' . pure
)
)
)
Expand Down

0 comments on commit c2b3cae

Please sign in to comment.