{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module GHC.Builtin.Types.Prim(
mkTemplateKindVar, mkTemplateKindVars,
mkTemplateTyVars, mkTemplateTyVarsFrom,
mkTemplateKiTyVars, mkTemplateKiTyVar,
mkTemplateTyConBinders, mkTemplateKindTyConBinders,
mkTemplateAnonTyConBinders,
alphaTyVars, alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar,
alphaTyVarSpec, betaTyVarSpec, gammaTyVarSpec, deltaTyVarSpec,
alphaTys, alphaTy, betaTy, gammaTy, deltaTy,
alphaTyVarsUnliftedRep, alphaTyVarUnliftedRep,
alphaTysUnliftedRep, alphaTyUnliftedRep,
runtimeRep1TyVar, runtimeRep2TyVar, runtimeRep3TyVar,
runtimeRep1TyVarInf, runtimeRep2TyVarInf,
runtimeRep1Ty, runtimeRep2Ty, runtimeRep3Ty,
levity1TyVar, levity2TyVar,
levity1TyVarInf, levity2TyVarInf,
levity1Ty, levity2Ty,
openAlphaTyVar, openBetaTyVar, openGammaTyVar,
openAlphaTyVarSpec, openBetaTyVarSpec, openGammaTyVarSpec,
openAlphaTy, openBetaTy, openGammaTy,
levPolyAlphaTyVar, levPolyBetaTyVar,
levPolyAlphaTyVarSpec, levPolyBetaTyVarSpec,
levPolyAlphaTy, levPolyBetaTy,
multiplicityTyVar1, multiplicityTyVar2,
tYPETyCon, tYPETyConName,
mkTYPEapp,
functionWithMultiplicity,
funTyCon, funTyConName,
unexposedPrimTyCons, exposedPrimTyCons, primTyCons,
charPrimTyCon, charPrimTy, charPrimTyConName,
intPrimTyCon, intPrimTy, intPrimTyConName,
wordPrimTyCon, wordPrimTy, wordPrimTyConName,
addrPrimTyCon, addrPrimTy, addrPrimTyConName,
floatPrimTyCon, floatPrimTy, floatPrimTyConName,
doublePrimTyCon, doublePrimTy, doublePrimTyConName,
statePrimTyCon, mkStatePrimTy,
realWorldTyCon, realWorldTy, realWorldStatePrimTy,
proxyPrimTyCon, mkProxyPrimTy,
arrayPrimTyCon, mkArrayPrimTy,
byteArrayPrimTyCon, byteArrayPrimTy,
smallArrayPrimTyCon, mkSmallArrayPrimTy,
mutableArrayPrimTyCon, mkMutableArrayPrimTy,
mutableByteArrayPrimTyCon, mkMutableByteArrayPrimTy,
smallMutableArrayPrimTyCon, mkSmallMutableArrayPrimTy,
mutVarPrimTyCon, mkMutVarPrimTy,
mVarPrimTyCon, mkMVarPrimTy,
ioPortPrimTyCon, mkIOPortPrimTy,
tVarPrimTyCon, mkTVarPrimTy,
stablePtrPrimTyCon, mkStablePtrPrimTy,
stableNamePrimTyCon, mkStableNamePrimTy,
compactPrimTyCon, compactPrimTy,
bcoPrimTyCon, bcoPrimTy,
weakPrimTyCon, mkWeakPrimTy,
threadIdPrimTyCon, threadIdPrimTy,
stackSnapshotPrimTyCon, stackSnapshotPrimTy,
int8PrimTyCon, int8PrimTy, int8PrimTyConName,
word8PrimTyCon, word8PrimTy, word8PrimTyConName,
int16PrimTyCon, int16PrimTy, int16PrimTyConName,
word16PrimTyCon, word16PrimTy, word16PrimTyConName,
int32PrimTyCon, int32PrimTy, int32PrimTyConName,
word32PrimTyCon, word32PrimTy, word32PrimTyConName,
int64PrimTyCon, int64PrimTy, int64PrimTyConName,
word64PrimTyCon, word64PrimTy, word64PrimTyConName,
eqPrimTyCon,
eqReprPrimTyCon,
eqPhantPrimTyCon,
equalityTyCon,
#include "primop-vector-tys-exports.hs-incl"
) where
import GHC.Prelude
import {-# SOURCE #-} GHC.Builtin.Types
( runtimeRepTy, levityTy, unboxedTupleKind, liftedTypeKind
, boxedRepDataConTyCon, vecRepDataConTyCon
, liftedRepTy, unliftedRepTy, zeroBitRepTy
, intRepDataConTy
, int8RepDataConTy, int16RepDataConTy, int32RepDataConTy, int64RepDataConTy
, wordRepDataConTy
, word16RepDataConTy, word8RepDataConTy, word32RepDataConTy, word64RepDataConTy
, addrRepDataConTy
, floatRepDataConTy, doubleRepDataConTy
, vec2DataConTy, vec4DataConTy, vec8DataConTy, vec16DataConTy, vec32DataConTy
, vec64DataConTy
, int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy
, int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy
, word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy
, doubleElemRepDataConTy
, multiplicityTy )
import GHC.Types.Var ( TyVarBinder, TyVar
, mkTyVar, mkTyVarBinder, mkTyVarBinders )
import GHC.Types.Name
import {-# SOURCE #-} GHC.Types.TyThing
import GHC.Core.TyCon
import GHC.Types.SrcLoc
import GHC.Types.Unique
import GHC.Builtin.Uniques
import GHC.Builtin.Names
import GHC.Data.FastString
import GHC.Utils.Misc ( changeLast )
import GHC.Core.TyCo.Rep
import {-# SOURCE #-} GHC.Core.Type ( mkTyConTy, mkTyConApp, mkTYPEapp, getLevity )
import Data.Char
primTyCons :: [TyCon]
primTyCons :: [TyCon]
primTyCons = [TyCon]
unexposedPrimTyCons [TyCon] -> [TyCon] -> [TyCon]
forall a. [a] -> [a] -> [a]
++ [TyCon]
exposedPrimTyCons
unexposedPrimTyCons :: [TyCon]
unexposedPrimTyCons :: [TyCon]
unexposedPrimTyCons
= [ TyCon
eqPrimTyCon
, TyCon
eqReprPrimTyCon
, TyCon
eqPhantPrimTyCon
]
exposedPrimTyCons :: [TyCon]
exposedPrimTyCons :: [TyCon]
exposedPrimTyCons
= [ TyCon
addrPrimTyCon
, TyCon
arrayPrimTyCon
, TyCon
byteArrayPrimTyCon
, TyCon
smallArrayPrimTyCon
, TyCon
charPrimTyCon
, TyCon
doublePrimTyCon
, TyCon
floatPrimTyCon
, TyCon
intPrimTyCon
, TyCon
int8PrimTyCon
, TyCon
int16PrimTyCon
, TyCon
int32PrimTyCon
, TyCon
int64PrimTyCon
, TyCon
bcoPrimTyCon
, TyCon
weakPrimTyCon
, TyCon
mutableArrayPrimTyCon
, TyCon
mutableByteArrayPrimTyCon
, TyCon
smallMutableArrayPrimTyCon
, TyCon
mVarPrimTyCon
, TyCon
ioPortPrimTyCon
, TyCon
tVarPrimTyCon
, TyCon
mutVarPrimTyCon
, TyCon
realWorldTyCon
, TyCon
stablePtrPrimTyCon
, TyCon
stableNamePrimTyCon
, TyCon
compactPrimTyCon
, TyCon
statePrimTyCon
, TyCon
proxyPrimTyCon
, TyCon
threadIdPrimTyCon
, TyCon
wordPrimTyCon
, TyCon
word8PrimTyCon
, TyCon
word16PrimTyCon
, TyCon
word32PrimTyCon
, TyCon
word64PrimTyCon
, TyCon
stackSnapshotPrimTyCon
, TyCon
tYPETyCon
, TyCon
funTyCon
#include "primop-vector-tycons.hs-incl"
]
mkPrimTc :: FastString -> Unique -> TyCon -> Name
mkPrimTc :: FastString -> Unique -> TyCon -> Name
mkPrimTc FastString
fs Unique
unique TyCon
tycon
= Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name
mkWiredInName Module
gHC_PRIM (FastString -> OccName
mkTcOccFS FastString
fs)
Unique
unique
(TyCon -> TyThing
mkATyCon TyCon
tycon)
BuiltInSyntax
UserSyntax
mkBuiltInPrimTc :: FastString -> Unique -> TyCon -> Name
mkBuiltInPrimTc :: FastString -> Unique -> TyCon -> Name
mkBuiltInPrimTc FastString
fs Unique
unique TyCon
tycon
= Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name
mkWiredInName Module
gHC_PRIM (FastString -> OccName
mkTcOccFS FastString
fs)
Unique
unique
(TyCon -> TyThing
mkATyCon TyCon
tycon)
BuiltInSyntax
BuiltInSyntax
charPrimTyConName, intPrimTyConName, int8PrimTyConName, int16PrimTyConName, int32PrimTyConName, int64PrimTyConName,
wordPrimTyConName, word32PrimTyConName, word8PrimTyConName, word16PrimTyConName, word64PrimTyConName,
addrPrimTyConName, floatPrimTyConName, doublePrimTyConName,
statePrimTyConName, proxyPrimTyConName, realWorldTyConName,
arrayPrimTyConName, smallArrayPrimTyConName, byteArrayPrimTyConName,
mutableArrayPrimTyConName, mutableByteArrayPrimTyConName,
smallMutableArrayPrimTyConName, mutVarPrimTyConName, mVarPrimTyConName,
ioPortPrimTyConName, tVarPrimTyConName, stablePtrPrimTyConName,
stableNamePrimTyConName, compactPrimTyConName, bcoPrimTyConName,
weakPrimTyConName, threadIdPrimTyConName,
eqPrimTyConName, eqReprPrimTyConName, eqPhantPrimTyConName,
stackSnapshotPrimTyConName :: Name
charPrimTyConName :: Name
charPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Char#") Unique
charPrimTyConKey TyCon
charPrimTyCon
intPrimTyConName :: Name
intPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Int#") Unique
intPrimTyConKey TyCon
intPrimTyCon
int8PrimTyConName :: Name
int8PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Int8#") Unique
int8PrimTyConKey TyCon
int8PrimTyCon
int16PrimTyConName :: Name
int16PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Int16#") Unique
int16PrimTyConKey TyCon
int16PrimTyCon
int32PrimTyConName :: Name
int32PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Int32#") Unique
int32PrimTyConKey TyCon
int32PrimTyCon
int64PrimTyConName :: Name
int64PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Int64#") Unique
int64PrimTyConKey TyCon
int64PrimTyCon
wordPrimTyConName :: Name
wordPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Word#") Unique
wordPrimTyConKey TyCon
wordPrimTyCon
word8PrimTyConName :: Name
word8PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Word8#") Unique
word8PrimTyConKey TyCon
word8PrimTyCon
word16PrimTyConName :: Name
word16PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Word16#") Unique
word16PrimTyConKey TyCon
word16PrimTyCon
word32PrimTyConName :: Name
word32PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Word32#") Unique
word32PrimTyConKey TyCon
word32PrimTyCon
word64PrimTyConName :: Name
word64PrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Word64#") Unique
word64PrimTyConKey TyCon
word64PrimTyCon
addrPrimTyConName :: Name
addrPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Addr#") Unique
addrPrimTyConKey TyCon
addrPrimTyCon
floatPrimTyConName :: Name
floatPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Float#") Unique
floatPrimTyConKey TyCon
floatPrimTyCon
doublePrimTyConName :: Name
doublePrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Double#") Unique
doublePrimTyConKey TyCon
doublePrimTyCon
statePrimTyConName :: Name
statePrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"State#") Unique
statePrimTyConKey TyCon
statePrimTyCon
proxyPrimTyConName :: Name
proxyPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Proxy#") Unique
proxyPrimTyConKey TyCon
proxyPrimTyCon
eqPrimTyConName :: Name
eqPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"~#") Unique
eqPrimTyConKey TyCon
eqPrimTyCon
eqReprPrimTyConName :: Name
eqReprPrimTyConName = FastString -> Unique -> TyCon -> Name
mkBuiltInPrimTc (String -> FastString
fsLit String
"~R#") Unique
eqReprPrimTyConKey TyCon
eqReprPrimTyCon
eqPhantPrimTyConName :: Name
eqPhantPrimTyConName = FastString -> Unique -> TyCon -> Name
mkBuiltInPrimTc (String -> FastString
fsLit String
"~P#") Unique
eqPhantPrimTyConKey TyCon
eqPhantPrimTyCon
realWorldTyConName :: Name
realWorldTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"RealWorld") Unique
realWorldTyConKey TyCon
realWorldTyCon
arrayPrimTyConName :: Name
arrayPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Array#") Unique
arrayPrimTyConKey TyCon
arrayPrimTyCon
byteArrayPrimTyConName :: Name
byteArrayPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"ByteArray#") Unique
byteArrayPrimTyConKey TyCon
byteArrayPrimTyCon
smallArrayPrimTyConName :: Name
smallArrayPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"SmallArray#") Unique
smallArrayPrimTyConKey TyCon
smallArrayPrimTyCon
mutableArrayPrimTyConName :: Name
mutableArrayPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"MutableArray#") Unique
mutableArrayPrimTyConKey TyCon
mutableArrayPrimTyCon
mutableByteArrayPrimTyConName :: Name
mutableByteArrayPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"MutableByteArray#") Unique
mutableByteArrayPrimTyConKey TyCon
mutableByteArrayPrimTyCon
smallMutableArrayPrimTyConName :: Name
smallMutableArrayPrimTyConName= FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"SmallMutableArray#") Unique
smallMutableArrayPrimTyConKey TyCon
smallMutableArrayPrimTyCon
mutVarPrimTyConName :: Name
mutVarPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"MutVar#") Unique
mutVarPrimTyConKey TyCon
mutVarPrimTyCon
ioPortPrimTyConName :: Name
ioPortPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"IOPort#") Unique
ioPortPrimTyConKey TyCon
ioPortPrimTyCon
mVarPrimTyConName :: Name
mVarPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"MVar#") Unique
mVarPrimTyConKey TyCon
mVarPrimTyCon
tVarPrimTyConName :: Name
tVarPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"TVar#") Unique
tVarPrimTyConKey TyCon
tVarPrimTyCon
stablePtrPrimTyConName :: Name
stablePtrPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"StablePtr#") Unique
stablePtrPrimTyConKey TyCon
stablePtrPrimTyCon
stableNamePrimTyConName :: Name
stableNamePrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"StableName#") Unique
stableNamePrimTyConKey TyCon
stableNamePrimTyCon
compactPrimTyConName :: Name
compactPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Compact#") Unique
compactPrimTyConKey TyCon
compactPrimTyCon
stackSnapshotPrimTyConName :: Name
stackSnapshotPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"StackSnapshot#") Unique
stackSnapshotPrimTyConKey TyCon
stackSnapshotPrimTyCon
bcoPrimTyConName :: Name
bcoPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"BCO") Unique
bcoPrimTyConKey TyCon
bcoPrimTyCon
weakPrimTyConName :: Name
weakPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"Weak#") Unique
weakPrimTyConKey TyCon
weakPrimTyCon
threadIdPrimTyConName :: Name
threadIdPrimTyConName = FastString -> Unique -> TyCon -> Name
mkPrimTc (String -> FastString
fsLit String
"ThreadId#") Unique
threadIdPrimTyConKey TyCon
threadIdPrimTyCon
mkTemplateKindVar :: Kind -> TyVar
mkTemplateKindVar :: Kind -> TyVar
mkTemplateKindVar = Name -> Kind -> TyVar
mkTyVar (Int -> String -> Name
mk_tv_name Int
0 String
"k")
mkTemplateKindVars :: [Kind] -> [TyVar]
mkTemplateKindVars :: [Kind] -> [TyVar]
mkTemplateKindVars [Kind
kind] = [Kind -> TyVar
mkTemplateKindVar Kind
kind]
mkTemplateKindVars [Kind]
kinds
= [ Name -> Kind -> TyVar
mkTyVar (Int -> String -> Name
mk_tv_name Int
u (Char
'k' Char -> String -> String
forall a. a -> [a] -> [a]
: Int -> String
forall a. Show a => a -> String
show Int
u)) Kind
kind
| (Kind
kind, Int
u) <- [Kind]
kinds [Kind] -> [Int] -> [(Kind, Int)]
forall a b. [a] -> [b] -> [(a, b)]
`zip` [Int
0..] ]
mk_tv_name :: Int -> String -> Name
mk_tv_name :: Int -> String -> Name
mk_tv_name Int
u String
s = Unique -> OccName -> SrcSpan -> Name
mkInternalName (Int -> Unique
mkAlphaTyVarUnique Int
u)
(FastString -> OccName
mkTyVarOccFS (String -> FastString
mkFastString String
s))
SrcSpan
noSrcSpan
mkTemplateTyVarsFrom :: Int -> [Kind] -> [TyVar]
mkTemplateTyVarsFrom :: Int -> [Kind] -> [TyVar]
mkTemplateTyVarsFrom Int
n [Kind]
kinds
= [ Name -> Kind -> TyVar
mkTyVar Name
name Kind
kind
| (Kind
kind, Int
index) <- [Kind] -> [Int] -> [(Kind, Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Kind]
kinds [Int
0..],
let ch_ord :: Int
ch_ord = Int
index Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Char -> Int
ord Char
'a'
name_str :: String
name_str | Int
ch_ord Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Char -> Int
ord Char
'z' = [Int -> Char
chr Int
ch_ord]
| Bool
otherwise = Char
't'Char -> String -> String
forall a. a -> [a] -> [a]
:Int -> String
forall a. Show a => a -> String
show Int
index
name :: Name
name = Int -> String -> Name
mk_tv_name (Int
index Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
n) String
name_str
]
mkTemplateTyVars :: [Kind] -> [TyVar]
mkTemplateTyVars :: [Kind] -> [TyVar]
mkTemplateTyVars = Int -> [Kind] -> [TyVar]
mkTemplateTyVarsFrom Int
1
mkTemplateTyConBinders
:: [Kind]
-> ([Kind] -> [Kind])
-> [TyConBinder]
mkTemplateTyConBinders :: [Kind] -> ([Kind] -> [Kind]) -> [TyConBinder]
mkTemplateTyConBinders [Kind]
kind_var_kinds [Kind] -> [Kind]
mk_anon_arg_kinds
= [TyConBinder]
kv_bndrs [TyConBinder] -> [TyConBinder] -> [TyConBinder]
forall a. [a] -> [a] -> [a]
++ [TyConBinder]
tv_bndrs
where
kv_bndrs :: [TyConBinder]
kv_bndrs = [Kind] -> [TyConBinder]
mkTemplateKindTyConBinders [Kind]
kind_var_kinds
anon_kinds :: [Kind]
anon_kinds = [Kind] -> [Kind]
mk_anon_arg_kinds ([TyVar] -> [Kind]
mkTyVarTys ([TyConBinder] -> [TyVar]
forall tv argf. [VarBndr tv argf] -> [tv]
binderVars [TyConBinder]
kv_bndrs))
tv_bndrs :: [TyConBinder]
tv_bndrs = Int -> [Kind] -> [TyConBinder]
mkTemplateAnonTyConBindersFrom ([TyConBinder] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [TyConBinder]
kv_bndrs) [Kind]
anon_kinds
mkTemplateKiTyVars
:: [Kind]
-> ([Kind] -> [Kind])
-> [TyVar]
mkTemplateKiTyVars :: [Kind] -> ([Kind] -> [Kind]) -> [TyVar]
mkTemplateKiTyVars [Kind]
kind_var_kinds [Kind] -> [Kind]
mk_arg_kinds
= [TyVar]
kv_bndrs [TyVar] -> [TyVar] -> [TyVar]
forall a. [a] -> [a] -> [a]
++ [TyVar]
tv_bndrs
where
kv_bndrs :: [TyVar]
kv_bndrs = [Kind] -> [TyVar]
mkTemplateKindVars [Kind]
kind_var_kinds
anon_kinds :: [Kind]
anon_kinds = [Kind] -> [Kind]
mk_arg_kinds ([TyVar] -> [Kind]
mkTyVarTys [TyVar]
kv_bndrs)
tv_bndrs :: [TyVar]
tv_bndrs = Int -> [Kind] -> [TyVar]
mkTemplateTyVarsFrom ([TyVar] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [TyVar]
kv_bndrs) [Kind]
anon_kinds
mkTemplateKiTyVar
:: Kind
-> (Kind -> [Kind])
-> [TyVar]
mkTemplateKiTyVar :: Kind -> (Kind -> [Kind]) -> [TyVar]
mkTemplateKiTyVar Kind
kind Kind -> [Kind]
mk_arg_kinds
= TyVar
kv_bndr TyVar -> [TyVar] -> [TyVar]
forall a. a -> [a] -> [a]
: [TyVar]
tv_bndrs
where
kv_bndr :: TyVar
kv_bndr = Kind -> TyVar
mkTemplateKindVar Kind
kind
anon_kinds :: [Kind]
anon_kinds = Kind -> [Kind]
mk_arg_kinds (TyVar -> Kind
mkTyVarTy TyVar
kv_bndr)
tv_bndrs :: [TyVar]
tv_bndrs = Int -> [Kind] -> [TyVar]
mkTemplateTyVarsFrom Int
1 [Kind]
anon_kinds
mkTemplateKindTyConBinders :: [Kind] -> [TyConBinder]
mkTemplateKindTyConBinders :: [Kind] -> [TyConBinder]
mkTemplateKindTyConBinders [Kind]
kinds = [ArgFlag -> TyVar -> TyConBinder
mkNamedTyConBinder ArgFlag
Specified TyVar
tv | TyVar
tv <- [Kind] -> [TyVar]
mkTemplateKindVars [Kind]
kinds]
mkTemplateAnonTyConBinders :: [Kind] -> [TyConBinder]
mkTemplateAnonTyConBinders :: [Kind] -> [TyConBinder]
mkTemplateAnonTyConBinders [Kind]
kinds = AnonArgFlag -> [TyVar] -> [TyConBinder]
mkAnonTyConBinders AnonArgFlag
VisArg ([Kind] -> [TyVar]
mkTemplateTyVars [Kind]
kinds)
mkTemplateAnonTyConBindersFrom :: Int -> [Kind] -> [TyConBinder]
mkTemplateAnonTyConBindersFrom :: Int -> [Kind] -> [TyConBinder]
mkTemplateAnonTyConBindersFrom Int
n [Kind]
kinds = AnonArgFlag -> [TyVar] -> [TyConBinder]
mkAnonTyConBinders AnonArgFlag
VisArg (Int -> [Kind] -> [TyVar]
mkTemplateTyVarsFrom Int
n [Kind]
kinds)
alphaTyVars :: [TyVar]
alphaTyVars :: [TyVar]
alphaTyVars = [Kind] -> [TyVar]
mkTemplateTyVars ([Kind] -> [TyVar]) -> [Kind] -> [TyVar]
forall a b. (a -> b) -> a -> b
$ Kind -> [Kind]
forall a. a -> [a]
repeat Kind
liftedTypeKind
alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar :: TyVar
(TyVar
alphaTyVar:TyVar
betaTyVar:TyVar
gammaTyVar:TyVar
deltaTyVar:[TyVar]
_) = [TyVar]
alphaTyVars
alphaTyVarSpec, betaTyVarSpec, gammaTyVarSpec, deltaTyVarSpec :: TyVarBinder
(TyVarBinder
alphaTyVarSpec:TyVarBinder
betaTyVarSpec:TyVarBinder
gammaTyVarSpec:TyVarBinder
deltaTyVarSpec:[TyVarBinder]
_) = ArgFlag -> [TyVar] -> [TyVarBinder]
forall vis. vis -> [TyVar] -> [VarBndr TyVar vis]
mkTyVarBinders ArgFlag
Specified [TyVar]
alphaTyVars
alphaTys :: [Type]
alphaTys :: [Kind]
alphaTys = [TyVar] -> [Kind]
mkTyVarTys [TyVar]
alphaTyVars
alphaTy, betaTy, gammaTy, deltaTy :: Type
(Kind
alphaTy:Kind
betaTy:Kind
gammaTy:Kind
deltaTy:[Kind]
_) = [Kind]
alphaTys
alphaTyVarsUnliftedRep :: [TyVar]
alphaTyVarsUnliftedRep :: [TyVar]
alphaTyVarsUnliftedRep = [Kind] -> [TyVar]
mkTemplateTyVars ([Kind] -> [TyVar]) -> [Kind] -> [TyVar]
forall a b. (a -> b) -> a -> b
$ Kind -> [Kind]
forall a. a -> [a]
repeat (Kind -> Kind
mkTYPEapp Kind
unliftedRepTy)
alphaTyVarUnliftedRep :: TyVar
(TyVar
alphaTyVarUnliftedRep:[TyVar]
_) = [TyVar]
alphaTyVarsUnliftedRep
alphaTysUnliftedRep :: [Type]
alphaTysUnliftedRep :: [Kind]
alphaTysUnliftedRep = [TyVar] -> [Kind]
mkTyVarTys [TyVar]
alphaTyVarsUnliftedRep
alphaTyUnliftedRep :: Type
(Kind
alphaTyUnliftedRep:[Kind]
_) = [Kind]
alphaTysUnliftedRep
runtimeRep1TyVar, runtimeRep2TyVar, runtimeRep3TyVar :: TyVar
(TyVar
runtimeRep1TyVar : TyVar
runtimeRep2TyVar : TyVar
runtimeRep3TyVar : [TyVar]
_)
= Int -> [TyVar] -> [TyVar]
forall a. Int -> [a] -> [a]
drop Int
16 ([Kind] -> [TyVar]
mkTemplateTyVars (Kind -> [Kind]
forall a. a -> [a]
repeat Kind
runtimeRepTy))
runtimeRep1TyVarInf, runtimeRep2TyVarInf :: TyVarBinder
runtimeRep1TyVarInf :: TyVarBinder
runtimeRep1TyVarInf = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Inferred TyVar
runtimeRep1TyVar
runtimeRep2TyVarInf :: TyVarBinder
runtimeRep2TyVarInf = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Inferred TyVar
runtimeRep2TyVar
runtimeRep1Ty, runtimeRep2Ty, runtimeRep3Ty :: Type
runtimeRep1Ty :: Kind
runtimeRep1Ty = TyVar -> Kind
mkTyVarTy TyVar
runtimeRep1TyVar
runtimeRep2Ty :: Kind
runtimeRep2Ty = TyVar -> Kind
mkTyVarTy TyVar
runtimeRep2TyVar
runtimeRep3Ty :: Kind
runtimeRep3Ty = TyVar -> Kind
mkTyVarTy TyVar
runtimeRep3TyVar
openAlphaTyVar, openBetaTyVar, openGammaTyVar :: TyVar
[TyVar
openAlphaTyVar,TyVar
openBetaTyVar,TyVar
openGammaTyVar]
= [Kind] -> [TyVar]
mkTemplateTyVars [Kind -> Kind
mkTYPEapp Kind
runtimeRep1Ty, Kind -> Kind
mkTYPEapp Kind
runtimeRep2Ty, Kind -> Kind
mkTYPEapp Kind
runtimeRep3Ty]
openAlphaTyVarSpec, openBetaTyVarSpec, openGammaTyVarSpec :: TyVarBinder
openAlphaTyVarSpec :: TyVarBinder
openAlphaTyVarSpec = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Specified TyVar
openAlphaTyVar
openBetaTyVarSpec :: TyVarBinder
openBetaTyVarSpec = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Specified TyVar
openBetaTyVar
openGammaTyVarSpec :: TyVarBinder
openGammaTyVarSpec = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Specified TyVar
openGammaTyVar
openAlphaTy, openBetaTy, openGammaTy :: Type
openAlphaTy :: Kind
openAlphaTy = TyVar -> Kind
mkTyVarTy TyVar
openAlphaTyVar
openBetaTy :: Kind
openBetaTy = TyVar -> Kind
mkTyVarTy TyVar
openBetaTyVar
openGammaTy :: Kind
openGammaTy = TyVar -> Kind
mkTyVarTy TyVar
openGammaTyVar
levity1TyVar, levity2TyVar :: TyVar
(TyVar
levity2TyVar : TyVar
levity1TyVar : [TyVar]
_)
= Int -> [TyVar] -> [TyVar]
forall a. Int -> [a] -> [a]
drop Int
10 ([Kind] -> [TyVar]
mkTemplateTyVars (Kind -> [Kind]
forall a. a -> [a]
repeat Kind
levityTy))
levity1TyVarInf, levity2TyVarInf :: TyVarBinder
levity1TyVarInf :: TyVarBinder
levity1TyVarInf = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Inferred TyVar
levity1TyVar
levity2TyVarInf :: TyVarBinder
levity2TyVarInf = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Inferred TyVar
levity2TyVar
levity1Ty, levity2Ty :: Type
levity1Ty :: Kind
levity1Ty = TyVar -> Kind
mkTyVarTy TyVar
levity1TyVar
levity2Ty :: Kind
levity2Ty = TyVar -> Kind
mkTyVarTy TyVar
levity2TyVar
levPolyAlphaTyVar, levPolyBetaTyVar :: TyVar
[TyVar
levPolyAlphaTyVar, TyVar
levPolyBetaTyVar] =
[Kind] -> [TyVar]
mkTemplateTyVars
[Kind -> Kind
mkTYPEapp (TyCon -> [Kind] -> Kind
mkTyConApp TyCon
boxedRepDataConTyCon [Kind
levity1Ty])
,Kind -> Kind
mkTYPEapp (TyCon -> [Kind] -> Kind
mkTyConApp TyCon
boxedRepDataConTyCon [Kind
levity2Ty])]
levPolyAlphaTyVarSpec, levPolyBetaTyVarSpec :: TyVarBinder
levPolyAlphaTyVarSpec :: TyVarBinder
levPolyAlphaTyVarSpec = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Specified TyVar
levPolyAlphaTyVar
levPolyBetaTyVarSpec :: TyVarBinder
levPolyBetaTyVarSpec = ArgFlag -> TyVar -> TyVarBinder
forall vis. vis -> TyVar -> VarBndr TyVar vis
mkTyVarBinder ArgFlag
Specified TyVar
levPolyBetaTyVar
levPolyAlphaTy, levPolyBetaTy :: Type
levPolyAlphaTy :: Kind
levPolyAlphaTy = TyVar -> Kind
mkTyVarTy TyVar
levPolyAlphaTyVar
levPolyBetaTy :: Kind
levPolyBetaTy = TyVar -> Kind
mkTyVarTy TyVar
levPolyBetaTyVar
multiplicityTyVar1, multiplicityTyVar2 :: TyVar
(TyVar
multiplicityTyVar1 : TyVar
multiplicityTyVar2 : [TyVar]
_)
= Int -> [TyVar] -> [TyVar]
forall a. Int -> [a] -> [a]
drop Int
13 ([Kind] -> [TyVar]
mkTemplateTyVars (Kind -> [Kind]
forall a. a -> [a]
repeat Kind
multiplicityTy))
funTyConName :: Name
funTyConName :: Name
funTyConName = BuiltInSyntax -> FastString -> Unique -> TyCon -> Name
mkPrimTcName BuiltInSyntax
UserSyntax (String -> FastString
fsLit String
"FUN") Unique
funTyConKey TyCon
funTyCon
funTyCon :: TyCon
funTyCon :: TyCon
funTyCon = Name -> [TyConBinder] -> Name -> TyCon
mkFunTyCon Name
funTyConName [TyConBinder]
tc_bndrs Name
tc_rep_nm
where
tc_bndrs :: [TyConBinder]
tc_bndrs = [ ArgFlag -> TyVar -> TyConBinder
mkNamedTyConBinder ArgFlag
Required TyVar
multiplicityTyVar1
, ArgFlag -> TyVar -> TyConBinder
mkNamedTyConBinder ArgFlag
Inferred TyVar
runtimeRep1TyVar
, ArgFlag -> TyVar -> TyConBinder
mkNamedTyConBinder ArgFlag
Inferred TyVar
runtimeRep2TyVar ]
[TyConBinder] -> [TyConBinder] -> [TyConBinder]
forall a. [a] -> [a] -> [a]
++ [Kind] -> [TyConBinder]
mkTemplateAnonTyConBinders [ Kind -> Kind
mkTYPEapp Kind
runtimeRep1Ty
, Kind -> Kind
mkTYPEapp Kind
runtimeRep2Ty
]
tc_rep_nm :: Name
tc_rep_nm = Name -> Name
mkPrelTyConRepName Name
funTyConName
tYPETyCon :: TyCon
tYPETyConName :: Name
tYPETyCon :: TyCon
tYPETyCon = Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
tYPETyConName
([Kind] -> [TyConBinder]
mkTemplateAnonTyConBinders [Kind
runtimeRepTy])
Kind
liftedTypeKind
[Role
Nominal]
tYPETyConName :: Name
tYPETyConName = BuiltInSyntax -> FastString -> Unique -> TyCon -> Name
mkPrimTcName BuiltInSyntax
UserSyntax (String -> FastString
fsLit String
"TYPE") Unique
tYPETyConKey TyCon
tYPETyCon
mkPrimTcName :: BuiltInSyntax -> FastString -> Unique -> TyCon -> Name
mkPrimTcName :: BuiltInSyntax -> FastString -> Unique -> TyCon -> Name
mkPrimTcName BuiltInSyntax
built_in_syntax FastString
occ Unique
key TyCon
tycon
= Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name
mkWiredInName Module
gHC_PRIM (FastString -> OccName
mkTcOccFS FastString
occ) Unique
key (TyCon -> TyThing
mkATyCon TyCon
tycon) BuiltInSyntax
built_in_syntax
functionWithMultiplicity :: Type -> Type
functionWithMultiplicity :: Kind -> Kind
functionWithMultiplicity Kind
mul = TyCon -> [Kind] -> Kind
TyConApp TyCon
funTyCon [Kind
mul]
pcPrimTyCon :: Name
-> [Role] -> RuntimeRepType -> TyCon
pcPrimTyCon :: Name -> [Role] -> Kind -> TyCon
pcPrimTyCon Name
name [Role]
roles Kind
res_rep
= Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
name [TyConBinder]
binders Kind
result_kind [Role]
roles
where
bndr_kis :: [Kind]
bndr_kis = Kind
liftedTypeKind Kind -> [Role] -> [Kind]
forall a b. a -> [b] -> [a]
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ [Role]
roles
binders :: [TyConBinder]
binders = [Kind] -> [TyConBinder]
mkTemplateAnonTyConBinders [Kind]
bndr_kis
result_kind :: Kind
result_kind = Kind -> Kind
mkTYPEapp Kind
res_rep
pcPrimTyCon0 :: Name -> RuntimeRepType -> TyCon
pcPrimTyCon0 :: Name -> Kind -> TyCon
pcPrimTyCon0 Name
name Kind
res_rep
= Name -> [Role] -> Kind -> TyCon
pcPrimTyCon Name
name [] Kind
res_rep
pcPrimTyCon_LevPolyLastArg :: Name
-> [Role]
-> RuntimeRepType
-> TyCon
pcPrimTyCon_LevPolyLastArg :: Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
name [Role]
roles Kind
res_rep
= Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
name [TyConBinder]
binders Kind
result_kind (Role
Nominal Role -> [Role] -> [Role]
forall a. a -> [a] -> [a]
: [Role]
roles)
where
result_kind :: Kind
result_kind = Kind -> Kind
mkTYPEapp Kind
res_rep
lev_bndr :: TyConBinder
lev_bndr = ArgFlag -> TyVar -> TyConBinder
mkNamedTyConBinder ArgFlag
Inferred TyVar
levity1TyVar
binders :: [TyConBinder]
binders = TyConBinder
lev_bndr TyConBinder -> [TyConBinder] -> [TyConBinder]
forall a. a -> [a] -> [a]
: [Kind] -> [TyConBinder]
mkTemplateAnonTyConBinders [Kind]
anon_bndr_kis
lev_tv :: Kind
lev_tv = TyVar -> Kind
mkTyVarTy (TyConBinder -> TyVar
forall tv argf. VarBndr tv argf -> tv
binderVar TyConBinder
lev_bndr)
anon_bndr_kis :: [Kind]
anon_bndr_kis = [Kind] -> Kind -> [Kind]
forall a. [a] -> a -> [a]
changeLast (Kind
liftedTypeKind Kind -> [Role] -> [Kind]
forall a b. a -> [b] -> [a]
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ [Role]
roles)
(Kind -> Kind
mkTYPEapp (Kind -> Kind) -> Kind -> Kind
forall a b. (a -> b) -> a -> b
$ TyCon -> [Kind] -> Kind
mkTyConApp TyCon
boxedRepDataConTyCon [Kind
lev_tv])
charPrimTy :: Type
charPrimTy :: Kind
charPrimTy = TyCon -> Kind
mkTyConTy TyCon
charPrimTyCon
charPrimTyCon :: TyCon
charPrimTyCon :: TyCon
charPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
charPrimTyConName Kind
wordRepDataConTy
intPrimTy :: Type
intPrimTy :: Kind
intPrimTy = TyCon -> Kind
mkTyConTy TyCon
intPrimTyCon
intPrimTyCon :: TyCon
intPrimTyCon :: TyCon
intPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
intPrimTyConName Kind
intRepDataConTy
int8PrimTy :: Type
int8PrimTy :: Kind
int8PrimTy = TyCon -> Kind
mkTyConTy TyCon
int8PrimTyCon
int8PrimTyCon :: TyCon
int8PrimTyCon :: TyCon
int8PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
int8PrimTyConName Kind
int8RepDataConTy
int16PrimTy :: Type
int16PrimTy :: Kind
int16PrimTy = TyCon -> Kind
mkTyConTy TyCon
int16PrimTyCon
int16PrimTyCon :: TyCon
int16PrimTyCon :: TyCon
int16PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
int16PrimTyConName Kind
int16RepDataConTy
int32PrimTy :: Type
int32PrimTy :: Kind
int32PrimTy = TyCon -> Kind
mkTyConTy TyCon
int32PrimTyCon
int32PrimTyCon :: TyCon
int32PrimTyCon :: TyCon
int32PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
int32PrimTyConName Kind
int32RepDataConTy
int64PrimTy :: Type
int64PrimTy :: Kind
int64PrimTy = TyCon -> Kind
mkTyConTy TyCon
int64PrimTyCon
int64PrimTyCon :: TyCon
int64PrimTyCon :: TyCon
int64PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
int64PrimTyConName Kind
int64RepDataConTy
wordPrimTy :: Type
wordPrimTy :: Kind
wordPrimTy = TyCon -> Kind
mkTyConTy TyCon
wordPrimTyCon
wordPrimTyCon :: TyCon
wordPrimTyCon :: TyCon
wordPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
wordPrimTyConName Kind
wordRepDataConTy
word8PrimTy :: Type
word8PrimTy :: Kind
word8PrimTy = TyCon -> Kind
mkTyConTy TyCon
word8PrimTyCon
word8PrimTyCon :: TyCon
word8PrimTyCon :: TyCon
word8PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
word8PrimTyConName Kind
word8RepDataConTy
word16PrimTy :: Type
word16PrimTy :: Kind
word16PrimTy = TyCon -> Kind
mkTyConTy TyCon
word16PrimTyCon
word16PrimTyCon :: TyCon
word16PrimTyCon :: TyCon
word16PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
word16PrimTyConName Kind
word16RepDataConTy
word32PrimTy :: Type
word32PrimTy :: Kind
word32PrimTy = TyCon -> Kind
mkTyConTy TyCon
word32PrimTyCon
word32PrimTyCon :: TyCon
word32PrimTyCon :: TyCon
word32PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
word32PrimTyConName Kind
word32RepDataConTy
word64PrimTy :: Type
word64PrimTy :: Kind
word64PrimTy = TyCon -> Kind
mkTyConTy TyCon
word64PrimTyCon
word64PrimTyCon :: TyCon
word64PrimTyCon :: TyCon
word64PrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
word64PrimTyConName Kind
word64RepDataConTy
addrPrimTy :: Type
addrPrimTy :: Kind
addrPrimTy = TyCon -> Kind
mkTyConTy TyCon
addrPrimTyCon
addrPrimTyCon :: TyCon
addrPrimTyCon :: TyCon
addrPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
addrPrimTyConName Kind
addrRepDataConTy
floatPrimTy :: Type
floatPrimTy :: Kind
floatPrimTy = TyCon -> Kind
mkTyConTy TyCon
floatPrimTyCon
floatPrimTyCon :: TyCon
floatPrimTyCon :: TyCon
floatPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
floatPrimTyConName Kind
floatRepDataConTy
doublePrimTy :: Type
doublePrimTy :: Kind
doublePrimTy = TyCon -> Kind
mkTyConTy TyCon
doublePrimTyCon
doublePrimTyCon :: TyCon
doublePrimTyCon :: TyCon
doublePrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
doublePrimTyConName Kind
doubleRepDataConTy
mkStatePrimTy :: Type -> Type
mkStatePrimTy :: Kind -> Kind
mkStatePrimTy Kind
ty = TyCon -> [Kind] -> Kind
TyConApp TyCon
statePrimTyCon [Kind
ty]
statePrimTyCon :: TyCon
statePrimTyCon :: TyCon
statePrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon Name
statePrimTyConName [Role
Nominal] Kind
zeroBitRepTy
realWorldTyCon :: TyCon
realWorldTyCon :: TyCon
realWorldTyCon = Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
realWorldTyConName [] Kind
liftedTypeKind []
realWorldTy :: Type
realWorldTy :: Kind
realWorldTy = TyCon -> Kind
mkTyConTy TyCon
realWorldTyCon
realWorldStatePrimTy :: Type
realWorldStatePrimTy :: Kind
realWorldStatePrimTy = Kind -> Kind
mkStatePrimTy Kind
realWorldTy
mkProxyPrimTy :: Type -> Type -> Type
mkProxyPrimTy :: Kind -> Kind -> Kind
mkProxyPrimTy Kind
k Kind
ty = TyCon -> [Kind] -> Kind
TyConApp TyCon
proxyPrimTyCon [Kind
k, Kind
ty]
proxyPrimTyCon :: TyCon
proxyPrimTyCon :: TyCon
proxyPrimTyCon = Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
proxyPrimTyConName [TyConBinder]
binders Kind
res_kind [Role
Nominal,Role
Phantom]
where
binders :: [TyConBinder]
binders = [Kind] -> ([Kind] -> [Kind]) -> [TyConBinder]
mkTemplateTyConBinders [Kind
liftedTypeKind] [Kind] -> [Kind]
forall a. a -> a
id
res_kind :: Kind
res_kind = [Kind] -> Kind
unboxedTupleKind []
eqPrimTyCon :: TyCon
eqPrimTyCon :: TyCon
eqPrimTyCon = Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
eqPrimTyConName [TyConBinder]
binders Kind
res_kind [Role]
roles
where
binders :: [TyConBinder]
binders = [Kind] -> ([Kind] -> [Kind]) -> [TyConBinder]
mkTemplateTyConBinders [Kind
liftedTypeKind, Kind
liftedTypeKind] [Kind] -> [Kind]
forall a. a -> a
id
res_kind :: Kind
res_kind = [Kind] -> Kind
unboxedTupleKind []
roles :: [Role]
roles = [Role
Nominal, Role
Nominal, Role
Nominal, Role
Nominal]
eqReprPrimTyCon :: TyCon
eqReprPrimTyCon :: TyCon
eqReprPrimTyCon = Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
eqReprPrimTyConName [TyConBinder]
binders Kind
res_kind [Role]
roles
where
binders :: [TyConBinder]
binders = [Kind] -> ([Kind] -> [Kind]) -> [TyConBinder]
mkTemplateTyConBinders [Kind
liftedTypeKind, Kind
liftedTypeKind] [Kind] -> [Kind]
forall a. a -> a
id
res_kind :: Kind
res_kind = [Kind] -> Kind
unboxedTupleKind []
roles :: [Role]
roles = [Role
Nominal, Role
Nominal, Role
Representational, Role
Representational]
eqPhantPrimTyCon :: TyCon
eqPhantPrimTyCon :: TyCon
eqPhantPrimTyCon = Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
mkPrimTyCon Name
eqPhantPrimTyConName [TyConBinder]
binders Kind
res_kind [Role]
roles
where
binders :: [TyConBinder]
binders = [Kind] -> ([Kind] -> [Kind]) -> [TyConBinder]
mkTemplateTyConBinders [Kind
liftedTypeKind, Kind
liftedTypeKind] [Kind] -> [Kind]
forall a. a -> a
id
res_kind :: Kind
res_kind = [Kind] -> Kind
unboxedTupleKind []
roles :: [Role]
roles = [Role
Nominal, Role
Nominal, Role
Phantom, Role
Phantom]
equalityTyCon :: Role -> TyCon
equalityTyCon :: Role -> TyCon
equalityTyCon Role
Nominal = TyCon
eqPrimTyCon
equalityTyCon Role
Representational = TyCon
eqReprPrimTyCon
equalityTyCon Role
Phantom = TyCon
eqPhantPrimTyCon
arrayPrimTyCon, mutableArrayPrimTyCon, mutableByteArrayPrimTyCon,
byteArrayPrimTyCon,
smallArrayPrimTyCon, smallMutableArrayPrimTyCon :: TyCon
arrayPrimTyCon :: TyCon
arrayPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
arrayPrimTyConName [Role
Representational] Kind
unliftedRepTy
mutableArrayPrimTyCon :: TyCon
mutableArrayPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
mutableArrayPrimTyConName [Role
Nominal, Role
Representational] Kind
unliftedRepTy
mutableByteArrayPrimTyCon :: TyCon
mutableByteArrayPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon Name
mutableByteArrayPrimTyConName [Role
Nominal] Kind
unliftedRepTy
byteArrayPrimTyCon :: TyCon
byteArrayPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
byteArrayPrimTyConName Kind
unliftedRepTy
smallArrayPrimTyCon :: TyCon
smallArrayPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
smallArrayPrimTyConName [Role
Representational] Kind
unliftedRepTy
smallMutableArrayPrimTyCon :: TyCon
smallMutableArrayPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
smallMutableArrayPrimTyConName [Role
Nominal, Role
Representational] Kind
unliftedRepTy
mkArrayPrimTy :: Type -> Type
mkArrayPrimTy :: Kind -> Kind
mkArrayPrimTy Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
arrayPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
elt]
byteArrayPrimTy :: Type
byteArrayPrimTy :: Kind
byteArrayPrimTy = TyCon -> Kind
mkTyConTy TyCon
byteArrayPrimTyCon
mkSmallArrayPrimTy :: Type -> Type
mkSmallArrayPrimTy :: Kind -> Kind
mkSmallArrayPrimTy Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
smallArrayPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
elt]
mkMutableArrayPrimTy :: Type -> Type -> Type
mkMutableArrayPrimTy :: Kind -> Kind -> Kind
mkMutableArrayPrimTy Kind
s Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
mutableArrayPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
s, Kind
elt]
mkMutableByteArrayPrimTy :: Type -> Type
mkMutableByteArrayPrimTy :: Kind -> Kind
mkMutableByteArrayPrimTy Kind
s = TyCon -> [Kind] -> Kind
TyConApp TyCon
mutableByteArrayPrimTyCon [Kind
s]
mkSmallMutableArrayPrimTy :: Type -> Type -> Type
mkSmallMutableArrayPrimTy :: Kind -> Kind -> Kind
mkSmallMutableArrayPrimTy Kind
s Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
smallMutableArrayPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
s, Kind
elt]
mutVarPrimTyCon :: TyCon
mutVarPrimTyCon :: TyCon
mutVarPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
mutVarPrimTyConName [Role
Nominal, Role
Representational] Kind
unliftedRepTy
mkMutVarPrimTy :: Type -> Type -> Type
mkMutVarPrimTy :: Kind -> Kind -> Kind
mkMutVarPrimTy Kind
s Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
mutVarPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
s, Kind
elt]
ioPortPrimTyCon :: TyCon
ioPortPrimTyCon :: TyCon
ioPortPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
ioPortPrimTyConName [Role
Nominal, Role
Representational] Kind
unliftedRepTy
mkIOPortPrimTy :: Type -> Type -> Type
mkIOPortPrimTy :: Kind -> Kind -> Kind
mkIOPortPrimTy Kind
s Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
ioPortPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
s, Kind
elt]
mVarPrimTyCon :: TyCon
mVarPrimTyCon :: TyCon
mVarPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
mVarPrimTyConName [Role
Nominal, Role
Representational] Kind
unliftedRepTy
mkMVarPrimTy :: Type -> Type -> Type
mkMVarPrimTy :: Kind -> Kind -> Kind
mkMVarPrimTy Kind
s Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
mVarPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
s, Kind
elt]
tVarPrimTyCon :: TyCon
tVarPrimTyCon :: TyCon
tVarPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
tVarPrimTyConName [Role
Nominal, Role
Representational] Kind
unliftedRepTy
mkTVarPrimTy :: Type -> Type -> Type
mkTVarPrimTy :: Kind -> Kind -> Kind
mkTVarPrimTy Kind
s Kind
elt = TyCon -> [Kind] -> Kind
TyConApp TyCon
tVarPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
elt, Kind
s, Kind
elt]
stablePtrPrimTyCon :: TyCon
stablePtrPrimTyCon :: TyCon
stablePtrPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
stablePtrPrimTyConName [Role
Representational] Kind
addrRepDataConTy
mkStablePtrPrimTy :: Type -> Type
mkStablePtrPrimTy :: Kind -> Kind
mkStablePtrPrimTy Kind
ty = TyCon -> [Kind] -> Kind
TyConApp TyCon
stablePtrPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
ty, Kind
ty]
stableNamePrimTyCon :: TyCon
stableNamePrimTyCon :: TyCon
stableNamePrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
stableNamePrimTyConName [Role
Phantom] Kind
unliftedRepTy
mkStableNamePrimTy :: Type -> Type
mkStableNamePrimTy :: Kind -> Kind
mkStableNamePrimTy Kind
ty = TyCon -> [Kind] -> Kind
TyConApp TyCon
stableNamePrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
ty, Kind
ty]
compactPrimTyCon :: TyCon
compactPrimTyCon :: TyCon
compactPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
compactPrimTyConName Kind
unliftedRepTy
compactPrimTy :: Type
compactPrimTy :: Kind
compactPrimTy = TyCon -> Kind
mkTyConTy TyCon
compactPrimTyCon
stackSnapshotPrimTyCon :: TyCon
stackSnapshotPrimTyCon :: TyCon
stackSnapshotPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
stackSnapshotPrimTyConName Kind
unliftedRepTy
stackSnapshotPrimTy :: Type
stackSnapshotPrimTy :: Kind
stackSnapshotPrimTy = TyCon -> Kind
mkTyConTy TyCon
stackSnapshotPrimTyCon
bcoPrimTy :: Type
bcoPrimTy :: Kind
bcoPrimTy = TyCon -> Kind
mkTyConTy TyCon
bcoPrimTyCon
bcoPrimTyCon :: TyCon
bcoPrimTyCon :: TyCon
bcoPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
bcoPrimTyConName Kind
liftedRepTy
weakPrimTyCon :: TyCon
weakPrimTyCon :: TyCon
weakPrimTyCon = Name -> [Role] -> Kind -> TyCon
pcPrimTyCon_LevPolyLastArg Name
weakPrimTyConName [Role
Representational] Kind
unliftedRepTy
mkWeakPrimTy :: Type -> Type
mkWeakPrimTy :: Kind -> Kind
mkWeakPrimTy Kind
v = TyCon -> [Kind] -> Kind
TyConApp TyCon
weakPrimTyCon [(() :: Constraint) => Kind -> Kind
Kind -> Kind
getLevity Kind
v, Kind
v]
threadIdPrimTy :: Type
threadIdPrimTy :: Kind
threadIdPrimTy = TyCon -> Kind
mkTyConTy TyCon
threadIdPrimTyCon
threadIdPrimTyCon :: TyCon
threadIdPrimTyCon :: TyCon
threadIdPrimTyCon = Name -> Kind -> TyCon
pcPrimTyCon0 Name
threadIdPrimTyConName Kind
unliftedRepTy
#include "primop-vector-tys.hs-incl"