Skip to content

Commit

Permalink
Rename some more things newtype -> nominal
Browse files Browse the repository at this point in the history
  • Loading branch information
yav committed Jan 31, 2024
1 parent c68ecfc commit c06fc89
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Cryptol/IR/TraverseNames.hs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ instance TraverseNames TPFlavor where
TPSchemaParam x -> TPSchemaParam <$> traverseNamesIP x
TPTySynParam x -> TPTySynParam <$> traverseNamesIP x
TPPropSynParam x -> TPPropSynParam <$> traverseNamesIP x
TPNewtypeParam x -> TPNewtypeParam <$> traverseNamesIP x
TPNominalParam x -> TPNominalParam <$> traverseNamesIP x
TPPrimParam x -> TPPrimParam <$> traverseNamesIP x

instance TraverseNames TVarInfo where
Expand Down
4 changes: 2 additions & 2 deletions src/Cryptol/TypeCheck/Kind.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ checkNewtype :: P.Newtype Name -> Maybe Text -> InferM NominalType
checkNewtype (P.Newtype x as con fs) mbD =
do ((as1,fs1),gs) <- collectGoals $
inRange (srcRange x) $
do r <- withTParams NoWildCards newtypeParam as $
do r <- withTParams NoWildCards nominalParam as $
flip traverseRecordMap fs $ \_n (rng,f) ->
kInRange rng $ doCheckType f (Just KType)
simplifyAllConstraints
Expand All @@ -157,7 +157,7 @@ checkEnum ed mbD =
do let x = P.eName ed
((as1,cons1),gs) <- collectGoals $
inRange (srcRange x) $
do r <- withTParams NoWildCards newtypeParam (P.eParams ed) $
do r <- withTParams NoWildCards nominalParam (P.eParams ed) $
forM (P.eCons ed `zip` [0..]) \(tlC,nu) ->
do let con = P.tlValue tlC
cname = P.ecName con
Expand Down
2 changes: 1 addition & 1 deletion src/Cryptol/TypeCheck/ModuleBacktickInstance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ instance AddParams a => AddParams [a] where

instance AddParams NominalType where
addParams nt =
do (tps,cs) <- newTypeParams TPNewtypeParam
do (tps,cs) <- newTypeParams TPNominalParam
rProps <- rewTypeM tps (ntConstraints nt)
def <- case ntDef nt of
Struct con ->
Expand Down
2 changes: 1 addition & 1 deletion src/Cryptol/TypeCheck/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ checkParamKind tp flav k =
TPPropSynParam _ -> starOrHashOrProp
TPTySynParam _ -> starOrHash
TPSchemaParam _ -> starOrHash
TPNewtypeParam _ -> starOrHash
TPNominalParam _ -> starOrHash
TPPrimParam _ -> starOrHash
TPUnifyVar -> starOrHash

Expand Down
12 changes: 6 additions & 6 deletions src/Cryptol/TypeCheck/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ data TPFlavor = TPModParam Name
| TPSchemaParam Name
| TPTySynParam Name
| TPPropSynParam Name
| TPNewtypeParam Name
| TPNominalParam Name
| TPPrimParam Name
deriving (Generic, NFData, Show)

Expand All @@ -173,8 +173,8 @@ tySynParam = TPTySynParam
propSynParam :: Name -> TPFlavor
propSynParam = TPPropSynParam

newtypeParam :: Name -> TPFlavor
newtypeParam = TPNewtypeParam
nominalParam :: Name -> TPFlavor
nominalParam = TPNominalParam

modTyParam :: Name -> TPFlavor
modTyParam = TPModParam
Expand All @@ -188,7 +188,7 @@ tpfName f =
TPSchemaParam x -> Just x
TPTySynParam x -> Just x
TPPropSynParam x -> Just x
TPNewtypeParam x -> Just x
TPNominalParam x -> Just x
TPPrimParam x -> Just x

tpName :: TParam -> Maybe Name
Expand All @@ -213,7 +213,7 @@ data Type = TCon !TCon ![Type]
-- ^ Record type

| TNominal !NominalType ![Type]
-- ^ A newtype
-- ^ A nominal types

deriving (Show, Generic, NFData)

Expand Down Expand Up @@ -1282,7 +1282,7 @@ instance PP (WithNames TVar) where
TPSchemaParam n -> declNm n
TPTySynParam n -> declNm n
TPPropSynParam n -> declNm n
TPNewtypeParam n -> declNm n
TPNominalParam n -> declNm n
TPPrimParam n -> declNm n

TVFree x k _ d -> pickTVarName k (tvarDesc d) x
Expand Down

0 comments on commit c06fc89

Please sign in to comment.