Commit 829be066 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Use kind 'Symbol' consistently, rather than kind 'String'

parent 09ff0e0d
......@@ -1411,11 +1411,11 @@ repTyConKey = mkPreludeTyConUnique 155
rep1TyConKey = mkPreludeTyConUnique 156
-- Type-level naturals
typeNatKindConNameKey, typeStringKindConNameKey,
typeNatKindConNameKey, typeSymbolKindConNameKey,
typeNatAddTyFamNameKey, typeNatMulTyFamNameKey, typeNatExpTyFamNameKey
:: Unique
typeNatKindConNameKey = mkPreludeTyConUnique 160
typeStringKindConNameKey = mkPreludeTyConUnique 161
typeSymbolKindConNameKey = mkPreludeTyConUnique 161
typeNatAddTyFamNameKey = mkPreludeTyConUnique 162
typeNatMulTyFamNameKey = mkPreludeTyConUnique 163
typeNatExpTyFamNameKey = mkPreludeTyConUnique 164
......
......@@ -65,7 +65,7 @@ module TysWiredIn (
unitTy,
-- * Kinds
typeNatKindCon, typeNatKind, typeStringKindCon, typeStringKind,
typeNatKindCon, typeNatKind, typeSymbolKindCon, typeSymbolKind,
-- * Parallel arrays
mkPArrTy,
......@@ -152,7 +152,7 @@ wiredInTyCons = [ unitTyCon -- Not treated like other tuples, because
, parrTyCon
, eqTyCon
, typeNatKindCon
, typeStringKindCon
, typeSymbolKindCon
]
++ (case cIntegerLibraryType of
IntegerGMP -> [integerTyCon]
......@@ -199,9 +199,9 @@ doubleTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "Double")
doubleDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "D#") doubleDataConKey doubleDataCon
-- Kinds
typeNatKindConName, typeStringKindConName :: Name
typeNatKindConName, typeSymbolKindConName :: Name
typeNatKindConName = mkWiredInTyConName UserSyntax gHC_TYPELITS (fsLit "Nat") typeNatKindConNameKey typeNatKindCon
typeStringKindConName = mkWiredInTyConName UserSyntax gHC_TYPELITS (fsLit "Symbol") typeStringKindConNameKey typeStringKindCon
typeSymbolKindConName = mkWiredInTyConName UserSyntax gHC_TYPELITS (fsLit "Symbol") typeSymbolKindConNameKey typeSymbolKindCon
-- For integer-gmp only:
integerRealTyConName :: Name
......@@ -304,15 +304,15 @@ pcDataConWithFixity' declared_infix dc_name wrk_key tyvars arg_tys tycon
%************************************************************************
\begin{code}
typeNatKindCon, typeStringKindCon :: TyCon
typeNatKindCon, typeSymbolKindCon :: TyCon
-- data Nat
-- data Symbol
typeNatKindCon = pcNonRecDataTyCon typeNatKindConName Nothing [] []
typeStringKindCon = pcNonRecDataTyCon typeStringKindConName Nothing [] []
typeNatKindCon = pcTyCon False NonRecursive True typeNatKindConName Nothing [] []
typeSymbolKindCon = pcTyCon False NonRecursive True typeSymbolKindConName Nothing [] []
typeNatKind, typeStringKind :: Kind
typeNatKind, typeSymbolKind :: Kind
typeNatKind = TyConApp (promoteTyCon typeNatKindCon) []
typeStringKind = TyConApp (promoteTyCon typeStringKindCon) []
typeSymbolKind = TyConApp (promoteTyCon typeSymbolKindCon) []
\end{code}
......
......@@ -6,6 +6,6 @@ import {-# SOURCE #-} TypeRep (Type)
eqTyCon :: TyCon
typeNatKind, typeStringKind :: Type
typeNatKind, typeSymbolKind :: Type
mkBoxedTupleTy :: [Type] -> Type
\end{code}
......@@ -511,8 +511,8 @@ tc_hs_type hs_ty@(HsTyLit (HsNumTy n)) exp_kind
; return (mkNumLitTy n) }
tc_hs_type hs_ty@(HsTyLit (HsStrTy s)) exp_kind
= do { checkExpectedKind hs_ty typeStringKind exp_kind
; checkWiredInTyCon typeStringKindCon
= do { checkExpectedKind hs_ty typeSymbolKind exp_kind
; checkWiredInTyCon typeSymbolKindCon
; return (mkStrLitTy s) }
---------------------------
......
......@@ -154,7 +154,7 @@ import VarSet
import Class
import TyCon
import TysPrim
import {-# SOURCE #-} TysWiredIn ( eqTyCon, typeNatKind, typeStringKind )
import {-# SOURCE #-} TysWiredIn ( eqTyCon, typeNatKind, typeSymbolKind )
import PrelNames ( eqTyConKey, ipClassNameKey,
constraintKindTyConKey, liftedTypeKindTyConKey )
import CoAxiom
......@@ -1630,7 +1630,7 @@ typeLiteralKind :: TyLit -> Kind
typeLiteralKind l =
case l of
NumTyLit _ -> typeNatKind
StrTyLit _ -> typeStringKind
StrTyLit _ -> typeSymbolKind
\end{code}
Kind inference
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment