Add Int8# and Word8#
[ghc.git] / compiler / prelude / TysPrim.hs
1 {-
2 (c) The AQUA Project, Glasgow University, 1994-1998
3
4
5 \section[TysPrim]{Wired-in knowledge about primitive types}
6 -}
7
8 {-# LANGUAGE CPP #-}
9
10 -- | This module defines TyCons that can't be expressed in Haskell.
11 -- They are all, therefore, wired-in TyCons. C.f module TysWiredIn
12 module TysPrim(
13 mkPrimTyConName, -- For implicit parameters in TysWiredIn only
14
15 mkTemplateKindVars, mkTemplateTyVars, mkTemplateTyVarsFrom,
16 mkTemplateKiTyVars,
17
18 mkTemplateTyConBinders, mkTemplateKindTyConBinders,
19 mkTemplateAnonTyConBinders,
20
21 alphaTyVars, alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar,
22 alphaTys, alphaTy, betaTy, gammaTy, deltaTy,
23 runtimeRep1TyVar, runtimeRep2TyVar, runtimeRep1Ty, runtimeRep2Ty,
24 openAlphaTy, openBetaTy, openAlphaTyVar, openBetaTyVar,
25
26 -- Kind constructors...
27 tYPETyCon, tYPETyConName,
28
29 -- Kinds
30 tYPE, primRepToRuntimeRep,
31
32 funTyCon, funTyConName,
33 unexposedPrimTyCons, exposedPrimTyCons, primTyCons,
34
35 charPrimTyCon, charPrimTy, charPrimTyConName,
36 intPrimTyCon, intPrimTy, intPrimTyConName,
37 wordPrimTyCon, wordPrimTy, wordPrimTyConName,
38 addrPrimTyCon, addrPrimTy, addrPrimTyConName,
39 floatPrimTyCon, floatPrimTy, floatPrimTyConName,
40 doublePrimTyCon, doublePrimTy, doublePrimTyConName,
41
42 voidPrimTyCon, voidPrimTy,
43 statePrimTyCon, mkStatePrimTy,
44 realWorldTyCon, realWorldTy, realWorldStatePrimTy,
45
46 proxyPrimTyCon, mkProxyPrimTy,
47
48 arrayPrimTyCon, mkArrayPrimTy,
49 byteArrayPrimTyCon, byteArrayPrimTy,
50 arrayArrayPrimTyCon, mkArrayArrayPrimTy,
51 smallArrayPrimTyCon, mkSmallArrayPrimTy,
52 mutableArrayPrimTyCon, mkMutableArrayPrimTy,
53 mutableByteArrayPrimTyCon, mkMutableByteArrayPrimTy,
54 mutableArrayArrayPrimTyCon, mkMutableArrayArrayPrimTy,
55 smallMutableArrayPrimTyCon, mkSmallMutableArrayPrimTy,
56 mutVarPrimTyCon, mkMutVarPrimTy,
57
58 mVarPrimTyCon, mkMVarPrimTy,
59 tVarPrimTyCon, mkTVarPrimTy,
60 stablePtrPrimTyCon, mkStablePtrPrimTy,
61 stableNamePrimTyCon, mkStableNamePrimTy,
62 compactPrimTyCon, compactPrimTy,
63 bcoPrimTyCon, bcoPrimTy,
64 weakPrimTyCon, mkWeakPrimTy,
65 threadIdPrimTyCon, threadIdPrimTy,
66
67 int8PrimTyCon, int8PrimTy,
68 word8PrimTyCon, word8PrimTy,
69
70 int32PrimTyCon, int32PrimTy,
71 word32PrimTyCon, word32PrimTy,
72
73 int64PrimTyCon, int64PrimTy,
74 word64PrimTyCon, word64PrimTy,
75
76 eqPrimTyCon, -- ty1 ~# ty2
77 eqReprPrimTyCon, -- ty1 ~R# ty2 (at role Representational)
78 eqPhantPrimTyCon, -- ty1 ~P# ty2 (at role Phantom)
79
80 -- * SIMD
81 #include "primop-vector-tys-exports.hs-incl"
82 ) where
83
84 #include "HsVersions.h"
85
86 import GhcPrelude
87
88 import {-# SOURCE #-} TysWiredIn
89 ( runtimeRepTy, unboxedTupleKind, liftedTypeKind
90 , vecRepDataConTyCon, tupleRepDataConTyCon
91 , liftedRepDataConTy, unliftedRepDataConTy, intRepDataConTy, int8RepDataConTy
92 , wordRepDataConTy, int64RepDataConTy, word8RepDataConTy, word64RepDataConTy
93 , addrRepDataConTy
94 , floatRepDataConTy, doubleRepDataConTy
95 , vec2DataConTy, vec4DataConTy, vec8DataConTy, vec16DataConTy, vec32DataConTy
96 , vec64DataConTy
97 , int8ElemRepDataConTy, int16ElemRepDataConTy, int32ElemRepDataConTy
98 , int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy
99 , word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy
100 , doubleElemRepDataConTy
101 , mkPromotedListTy )
102
103 import Var ( TyVar, VarBndr(Bndr), mkTyVar )
104 import Name
105 import TyCon
106 import SrcLoc
107 import Unique
108 import PrelNames
109 import FastString
110 import Outputable
111 import TyCoRep -- Doesn't need special access, but this is easier to avoid
112 -- import loops which show up if you import Type instead
113
114 import Data.Char
115
116 {-
117 ************************************************************************
118 * *
119 \subsection{Primitive type constructors}
120 * *
121 ************************************************************************
122 -}
123
124 primTyCons :: [TyCon]
125 primTyCons = unexposedPrimTyCons ++ exposedPrimTyCons
126
127 -- | Primitive 'TyCon's that are defined in "GHC.Prim" but not exposed.
128 -- It's important to keep these separate as we don't want users to be able to
129 -- write them (see Trac #15209) or see them in GHCi's @:browse@ output
130 -- (see Trac #12023).
131 unexposedPrimTyCons :: [TyCon]
132 unexposedPrimTyCons
133 = [ eqPrimTyCon
134 , eqReprPrimTyCon
135 , eqPhantPrimTyCon
136 ]
137
138 -- | Primitive 'TyCon's that are defined in, and exported from, "GHC.Prim".
139 exposedPrimTyCons :: [TyCon]
140 exposedPrimTyCons
141 = [ addrPrimTyCon
142 , arrayPrimTyCon
143 , byteArrayPrimTyCon
144 , arrayArrayPrimTyCon
145 , smallArrayPrimTyCon
146 , charPrimTyCon
147 , doublePrimTyCon
148 , floatPrimTyCon
149 , intPrimTyCon
150 , int8PrimTyCon
151 , int32PrimTyCon
152 , int64PrimTyCon
153 , bcoPrimTyCon
154 , weakPrimTyCon
155 , mutableArrayPrimTyCon
156 , mutableByteArrayPrimTyCon
157 , mutableArrayArrayPrimTyCon
158 , smallMutableArrayPrimTyCon
159 , mVarPrimTyCon
160 , tVarPrimTyCon
161 , mutVarPrimTyCon
162 , realWorldTyCon
163 , stablePtrPrimTyCon
164 , stableNamePrimTyCon
165 , compactPrimTyCon
166 , statePrimTyCon
167 , voidPrimTyCon
168 , proxyPrimTyCon
169 , threadIdPrimTyCon
170 , wordPrimTyCon
171 , word8PrimTyCon
172 , word32PrimTyCon
173 , word64PrimTyCon
174
175 , tYPETyCon
176
177 #include "primop-vector-tycons.hs-incl"
178 ]
179
180 mkPrimTc :: FastString -> Unique -> TyCon -> Name
181 mkPrimTc fs unique tycon
182 = mkWiredInName gHC_PRIM (mkTcOccFS fs)
183 unique
184 (ATyCon tycon) -- Relevant TyCon
185 UserSyntax
186
187 mkBuiltInPrimTc :: FastString -> Unique -> TyCon -> Name
188 mkBuiltInPrimTc fs unique tycon
189 = mkWiredInName gHC_PRIM (mkTcOccFS fs)
190 unique
191 (ATyCon tycon) -- Relevant TyCon
192 BuiltInSyntax
193
194
195 charPrimTyConName, intPrimTyConName, int8PrimTyConName, int32PrimTyConName, int64PrimTyConName, wordPrimTyConName, word32PrimTyConName, word8PrimTyConName, word64PrimTyConName, addrPrimTyConName, floatPrimTyConName, doublePrimTyConName, statePrimTyConName, proxyPrimTyConName, realWorldTyConName, arrayPrimTyConName, arrayArrayPrimTyConName, smallArrayPrimTyConName, byteArrayPrimTyConName, mutableArrayPrimTyConName, mutableByteArrayPrimTyConName, mutableArrayArrayPrimTyConName, smallMutableArrayPrimTyConName, mutVarPrimTyConName, mVarPrimTyConName, tVarPrimTyConName, stablePtrPrimTyConName, stableNamePrimTyConName, compactPrimTyConName, bcoPrimTyConName, weakPrimTyConName, threadIdPrimTyConName, eqPrimTyConName, eqReprPrimTyConName, eqPhantPrimTyConName, voidPrimTyConName :: Name
196 charPrimTyConName = mkPrimTc (fsLit "Char#") charPrimTyConKey charPrimTyCon
197 intPrimTyConName = mkPrimTc (fsLit "Int#") intPrimTyConKey intPrimTyCon
198 int8PrimTyConName = mkPrimTc (fsLit "Int8#") int8PrimTyConKey int8PrimTyCon
199 int32PrimTyConName = mkPrimTc (fsLit "Int32#") int32PrimTyConKey int32PrimTyCon
200 int64PrimTyConName = mkPrimTc (fsLit "Int64#") int64PrimTyConKey int64PrimTyCon
201 wordPrimTyConName = mkPrimTc (fsLit "Word#") wordPrimTyConKey wordPrimTyCon
202 word8PrimTyConName = mkPrimTc (fsLit "Word8#") word8PrimTyConKey word8PrimTyCon
203 word32PrimTyConName = mkPrimTc (fsLit "Word32#") word32PrimTyConKey word32PrimTyCon
204 word64PrimTyConName = mkPrimTc (fsLit "Word64#") word64PrimTyConKey word64PrimTyCon
205 addrPrimTyConName = mkPrimTc (fsLit "Addr#") addrPrimTyConKey addrPrimTyCon
206 floatPrimTyConName = mkPrimTc (fsLit "Float#") floatPrimTyConKey floatPrimTyCon
207 doublePrimTyConName = mkPrimTc (fsLit "Double#") doublePrimTyConKey doublePrimTyCon
208 statePrimTyConName = mkPrimTc (fsLit "State#") statePrimTyConKey statePrimTyCon
209 voidPrimTyConName = mkPrimTc (fsLit "Void#") voidPrimTyConKey voidPrimTyCon
210 proxyPrimTyConName = mkPrimTc (fsLit "Proxy#") proxyPrimTyConKey proxyPrimTyCon
211 eqPrimTyConName = mkPrimTc (fsLit "~#") eqPrimTyConKey eqPrimTyCon
212 eqReprPrimTyConName = mkBuiltInPrimTc (fsLit "~R#") eqReprPrimTyConKey eqReprPrimTyCon
213 eqPhantPrimTyConName = mkBuiltInPrimTc (fsLit "~P#") eqPhantPrimTyConKey eqPhantPrimTyCon
214 realWorldTyConName = mkPrimTc (fsLit "RealWorld") realWorldTyConKey realWorldTyCon
215 arrayPrimTyConName = mkPrimTc (fsLit "Array#") arrayPrimTyConKey arrayPrimTyCon
216 byteArrayPrimTyConName = mkPrimTc (fsLit "ByteArray#") byteArrayPrimTyConKey byteArrayPrimTyCon
217 arrayArrayPrimTyConName = mkPrimTc (fsLit "ArrayArray#") arrayArrayPrimTyConKey arrayArrayPrimTyCon
218 smallArrayPrimTyConName = mkPrimTc (fsLit "SmallArray#") smallArrayPrimTyConKey smallArrayPrimTyCon
219 mutableArrayPrimTyConName = mkPrimTc (fsLit "MutableArray#") mutableArrayPrimTyConKey mutableArrayPrimTyCon
220 mutableByteArrayPrimTyConName = mkPrimTc (fsLit "MutableByteArray#") mutableByteArrayPrimTyConKey mutableByteArrayPrimTyCon
221 mutableArrayArrayPrimTyConName= mkPrimTc (fsLit "MutableArrayArray#") mutableArrayArrayPrimTyConKey mutableArrayArrayPrimTyCon
222 smallMutableArrayPrimTyConName= mkPrimTc (fsLit "SmallMutableArray#") smallMutableArrayPrimTyConKey smallMutableArrayPrimTyCon
223 mutVarPrimTyConName = mkPrimTc (fsLit "MutVar#") mutVarPrimTyConKey mutVarPrimTyCon
224 mVarPrimTyConName = mkPrimTc (fsLit "MVar#") mVarPrimTyConKey mVarPrimTyCon
225 tVarPrimTyConName = mkPrimTc (fsLit "TVar#") tVarPrimTyConKey tVarPrimTyCon
226 stablePtrPrimTyConName = mkPrimTc (fsLit "StablePtr#") stablePtrPrimTyConKey stablePtrPrimTyCon
227 stableNamePrimTyConName = mkPrimTc (fsLit "StableName#") stableNamePrimTyConKey stableNamePrimTyCon
228 compactPrimTyConName = mkPrimTc (fsLit "Compact#") compactPrimTyConKey compactPrimTyCon
229 bcoPrimTyConName = mkPrimTc (fsLit "BCO#") bcoPrimTyConKey bcoPrimTyCon
230 weakPrimTyConName = mkPrimTc (fsLit "Weak#") weakPrimTyConKey weakPrimTyCon
231 threadIdPrimTyConName = mkPrimTc (fsLit "ThreadId#") threadIdPrimTyConKey threadIdPrimTyCon
232
233 {-
234 ************************************************************************
235 * *
236 \subsection{Support code}
237 * *
238 ************************************************************************
239
240 alphaTyVars is a list of type variables for use in templates:
241 ["a", "b", ..., "z", "t1", "t2", ... ]
242 -}
243
244 mkTemplateKindVars :: [Kind] -> [TyVar]
245 -- k0 with unique (mkAlphaTyVarUnique 0)
246 -- k1 with unique (mkAlphaTyVarUnique 1)
247 -- ... etc
248 mkTemplateKindVars kinds
249 = [ mkTyVar name kind
250 | (kind, u) <- kinds `zip` [0..]
251 , let occ = mkTyVarOccFS (mkFastString ('k' : show u))
252 name = mkInternalName (mkAlphaTyVarUnique u) occ noSrcSpan
253 ]
254
255 mkTemplateTyVarsFrom :: Int -> [Kind] -> [TyVar]
256 -- a with unique (mkAlphaTyVarUnique n)
257 -- b with unique (mkAlphaTyVarUnique n+1)
258 -- ... etc
259 -- Typically called as
260 -- mkTemplateTyVarsFrom (length kv_bndrs) kinds
261 -- where kv_bndrs are the kind-level binders of a TyCon
262 mkTemplateTyVarsFrom n kinds
263 = [ mkTyVar name kind
264 | (kind, index) <- zip kinds [0..],
265 let ch_ord = index + ord 'a'
266 name_str | ch_ord <= ord 'z' = [chr ch_ord]
267 | otherwise = 't':show index
268 uniq = mkAlphaTyVarUnique (index + n)
269 name = mkInternalName uniq occ noSrcSpan
270 occ = mkTyVarOccFS (mkFastString name_str)
271 ]
272
273 mkTemplateTyVars :: [Kind] -> [TyVar]
274 mkTemplateTyVars = mkTemplateTyVarsFrom 1
275
276 mkTemplateTyConBinders
277 :: [Kind] -- [k1, .., kn] Kinds of kind-forall'd vars
278 -> ([Kind] -> [Kind]) -- Arg is [kv1:k1, ..., kvn:kn]
279 -- same length as first arg
280 -- Result is anon arg kinds
281 -> [TyConBinder]
282 mkTemplateTyConBinders kind_var_kinds mk_anon_arg_kinds
283 = kv_bndrs ++ tv_bndrs
284 where
285 kv_bndrs = mkTemplateKindTyConBinders kind_var_kinds
286 anon_kinds = mk_anon_arg_kinds (mkTyVarTys (binderVars kv_bndrs))
287 tv_bndrs = mkTemplateAnonTyConBindersFrom (length kv_bndrs) anon_kinds
288
289 mkTemplateKiTyVars
290 :: [Kind] -- [k1, .., kn] Kinds of kind-forall'd vars
291 -> ([Kind] -> [Kind]) -- Arg is [kv1:k1, ..., kvn:kn]
292 -- same length as first arg
293 -- Result is anon arg kinds [ak1, .., akm]
294 -> [TyVar] -- [kv1:k1, ..., kvn:kn, av1:ak1, ..., avm:akm]
295 -- Example: if you want the tyvars for
296 -- forall (r:RuntimeRep) (a:TYPE r) (b:*). blah
297 -- call mkTemplateKiTyVars [RuntimeRep] (\[r]. [TYPE r, *)
298 mkTemplateKiTyVars kind_var_kinds mk_arg_kinds
299 = kv_bndrs ++ tv_bndrs
300 where
301 kv_bndrs = mkTemplateKindVars kind_var_kinds
302 anon_kinds = mk_arg_kinds (mkTyVarTys kv_bndrs)
303 tv_bndrs = mkTemplateTyVarsFrom (length kv_bndrs) anon_kinds
304
305 mkTemplateKindTyConBinders :: [Kind] -> [TyConBinder]
306 -- Makes named, Specified binders
307 mkTemplateKindTyConBinders kinds = [mkNamedTyConBinder Specified tv | tv <- mkTemplateKindVars kinds]
308
309 mkTemplateAnonTyConBinders :: [Kind] -> [TyConBinder]
310 mkTemplateAnonTyConBinders kinds = map mkAnonTyConBinder (mkTemplateTyVars kinds)
311
312 mkTemplateAnonTyConBindersFrom :: Int -> [Kind] -> [TyConBinder]
313 mkTemplateAnonTyConBindersFrom n kinds = map mkAnonTyConBinder (mkTemplateTyVarsFrom n kinds)
314
315 alphaTyVars :: [TyVar]
316 alphaTyVars = mkTemplateTyVars $ repeat liftedTypeKind
317
318 alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar :: TyVar
319 (alphaTyVar:betaTyVar:gammaTyVar:deltaTyVar:_) = alphaTyVars
320
321 alphaTys :: [Type]
322 alphaTys = mkTyVarTys alphaTyVars
323 alphaTy, betaTy, gammaTy, deltaTy :: Type
324 (alphaTy:betaTy:gammaTy:deltaTy:_) = alphaTys
325
326 runtimeRep1TyVar, runtimeRep2TyVar :: TyVar
327 (runtimeRep1TyVar : runtimeRep2TyVar : _)
328 = drop 16 (mkTemplateTyVars (repeat runtimeRepTy)) -- selects 'q','r'
329
330 runtimeRep1Ty, runtimeRep2Ty :: Type
331 runtimeRep1Ty = mkTyVarTy runtimeRep1TyVar
332 runtimeRep2Ty = mkTyVarTy runtimeRep2TyVar
333
334 openAlphaTyVar, openBetaTyVar :: TyVar
335 [openAlphaTyVar,openBetaTyVar]
336 = mkTemplateTyVars [tYPE runtimeRep1Ty, tYPE runtimeRep2Ty]
337
338 openAlphaTy, openBetaTy :: Type
339 openAlphaTy = mkTyVarTy openAlphaTyVar
340 openBetaTy = mkTyVarTy openBetaTyVar
341
342 {-
343 ************************************************************************
344 * *
345 FunTyCon
346 * *
347 ************************************************************************
348 -}
349
350 funTyConName :: Name
351 funTyConName = mkPrimTyConName (fsLit "->") funTyConKey funTyCon
352
353 -- | The @(->)@ type constructor.
354 --
355 -- @
356 -- (->) :: forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep).
357 -- TYPE rep1 -> TYPE rep2 -> *
358 -- @
359 funTyCon :: TyCon
360 funTyCon = mkFunTyCon funTyConName tc_bndrs tc_rep_nm
361 where
362 tc_bndrs = [ Bndr runtimeRep1TyVar (NamedTCB Inferred)
363 , Bndr runtimeRep2TyVar (NamedTCB Inferred)
364 ]
365 ++ mkTemplateAnonTyConBinders [ tYPE runtimeRep1Ty
366 , tYPE runtimeRep2Ty
367 ]
368 tc_rep_nm = mkPrelTyConRepName funTyConName
369
370 {-
371 ************************************************************************
372 * *
373 Kinds
374 * *
375 ************************************************************************
376
377 Note [TYPE and RuntimeRep]
378 ~~~~~~~~~~~~~~~~~~~~~~~~~~
379 All types that classify values have a kind of the form (TYPE rr), where
380
381 data RuntimeRep -- Defined in ghc-prim:GHC.Types
382 = LiftedRep
383 | UnliftedRep
384 | IntRep
385 | FloatRep
386 .. etc ..
387
388 rr :: RuntimeRep
389
390 TYPE :: RuntimeRep -> TYPE 'LiftedRep -- Built in
391
392 So for example:
393 Int :: TYPE 'LiftedRep
394 Array# Int :: TYPE 'UnliftedRep
395 Int# :: TYPE 'IntRep
396 Float# :: TYPE 'FloatRep
397 Maybe :: TYPE 'LiftedRep -> TYPE 'LiftedRep
398 (# , #) :: TYPE r1 -> TYPE r2 -> TYPE (TupleRep [r1, r2])
399
400 We abbreviate '*' specially:
401 type * = TYPE 'LiftedRep
402
403 The 'rr' parameter tells us how the value is represented at runime.
404
405 Generally speaking, you can't be polymorphic in 'rr'. E.g
406 f :: forall (rr:RuntimeRep) (a:TYPE rr). a -> [a]
407 f = /\(rr:RuntimeRep) (a:rr) \(a:rr). ...
408 This is no good: we could not generate code code for 'f', because the
409 calling convention for 'f' varies depending on whether the argument is
410 a a Int, Int#, or Float#. (You could imagine generating specialised
411 code, one for each instantiation of 'rr', but we don't do that.)
412
413 Certain functions CAN be runtime-rep-polymorphic, because the code
414 generator never has to manipulate a value of type 'a :: TYPE rr'.
415
416 * error :: forall (rr:RuntimeRep) (a:TYPE rr). String -> a
417 Code generator never has to manipulate the return value.
418
419 * unsafeCoerce#, defined in MkId.unsafeCoerceId:
420 Always inlined to be a no-op
421 unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
422 (a :: TYPE r1) (b :: TYPE r2).
423 a -> b
424
425 * Unboxed tuples, and unboxed sums, defined in TysWiredIn
426 Always inlined, and hence specialised to the call site
427 (#,#) :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep)
428 (a :: TYPE r1) (b :: TYPE r2).
429 a -> b -> TYPE ('TupleRep '[r1, r2])
430
431 Note [PrimRep and kindPrimRep]
432 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433 As part of its source code, in TyCon, GHC has
434 data PrimRep = LiftedRep | UnliftedRep | IntRep | FloatRep | ...etc...
435
436 Notice that
437 * RuntimeRep is part of the syntax tree of the program being compiled
438 (defined in a library: ghc-prim:GHC.Types)
439 * PrimRep is part of GHC's source code.
440 (defined in TyCon)
441
442 We need to get from one to the other; that is what kindPrimRep does.
443 Suppose we have a value
444 (v :: t) where (t :: k)
445 Given this kind
446 k = TyConApp "TYPE" [rep]
447 GHC needs to be able to figure out how 'v' is represented at runtime.
448 It expects 'rep' to be form
449 TyConApp rr_dc args
450 where 'rr_dc' is a promoteed data constructor from RuntimeRep. So
451 now we need to go from 'dc' to the corresponding PrimRep. We store this
452 PrimRep in the promoted data constructor itself: see TyCon.promDcRepInfo.
453
454 -}
455
456 tYPETyCon :: TyCon
457 tYPETyConName :: Name
458
459 tYPETyCon = mkKindTyCon tYPETyConName
460 (mkTemplateAnonTyConBinders [runtimeRepTy])
461 liftedTypeKind
462 [Nominal]
463 (mkPrelTyConRepName tYPETyConName)
464
465 --------------------------
466 -- ... and now their names
467
468 -- If you edit these, you may need to update the GHC formalism
469 -- See Note [GHC Formalism] in coreSyn/CoreLint.hs
470 tYPETyConName = mkPrimTyConName (fsLit "TYPE") tYPETyConKey tYPETyCon
471
472 mkPrimTyConName :: FastString -> Unique -> TyCon -> Name
473 mkPrimTyConName = mkPrimTcName BuiltInSyntax
474 -- All of the super kinds and kinds are defined in Prim,
475 -- and use BuiltInSyntax, because they are never in scope in the source
476
477 mkPrimTcName :: BuiltInSyntax -> FastString -> Unique -> TyCon -> Name
478 mkPrimTcName built_in_syntax occ key tycon
479 = mkWiredInName gHC_PRIM (mkTcOccFS occ) key (ATyCon tycon) built_in_syntax
480
481 -----------------------------
482 -- | Given a RuntimeRep, applies TYPE to it.
483 -- see Note [TYPE and RuntimeRep]
484 tYPE :: Type -> Type
485 tYPE rr = TyConApp tYPETyCon [rr]
486
487 {-
488 ************************************************************************
489 * *
490 \subsection[TysPrim-basic]{Basic primitive types (@Char#@, @Int#@, etc.)}
491 * *
492 ************************************************************************
493 -}
494
495 -- only used herein
496 pcPrimTyCon :: Name -> [Role] -> PrimRep -> TyCon
497 pcPrimTyCon name roles rep
498 = mkPrimTyCon name binders result_kind roles
499 where
500 binders = mkTemplateAnonTyConBinders (map (const liftedTypeKind) roles)
501 result_kind = tYPE (primRepToRuntimeRep rep)
502
503 -- | Convert a 'PrimRep' to a 'Type' of kind RuntimeRep
504 -- Defined here to avoid (more) module loops
505 primRepToRuntimeRep :: PrimRep -> Type
506 primRepToRuntimeRep rep = case rep of
507 VoidRep -> TyConApp tupleRepDataConTyCon [mkPromotedListTy runtimeRepTy []]
508 LiftedRep -> liftedRepDataConTy
509 UnliftedRep -> unliftedRepDataConTy
510 IntRep -> intRepDataConTy
511 Int8Rep -> int8RepDataConTy
512 WordRep -> wordRepDataConTy
513 Int64Rep -> int64RepDataConTy
514 Word8Rep -> word8RepDataConTy
515 Word64Rep -> word64RepDataConTy
516 AddrRep -> addrRepDataConTy
517 FloatRep -> floatRepDataConTy
518 DoubleRep -> doubleRepDataConTy
519 VecRep n elem -> TyConApp vecRepDataConTyCon [n', elem']
520 where
521 n' = case n of
522 2 -> vec2DataConTy
523 4 -> vec4DataConTy
524 8 -> vec8DataConTy
525 16 -> vec16DataConTy
526 32 -> vec32DataConTy
527 64 -> vec64DataConTy
528 _ -> pprPanic "Disallowed VecCount" (ppr n)
529
530 elem' = case elem of
531 Int8ElemRep -> int8ElemRepDataConTy
532 Int16ElemRep -> int16ElemRepDataConTy
533 Int32ElemRep -> int32ElemRepDataConTy
534 Int64ElemRep -> int64ElemRepDataConTy
535 Word8ElemRep -> word8ElemRepDataConTy
536 Word16ElemRep -> word16ElemRepDataConTy
537 Word32ElemRep -> word32ElemRepDataConTy
538 Word64ElemRep -> word64ElemRepDataConTy
539 FloatElemRep -> floatElemRepDataConTy
540 DoubleElemRep -> doubleElemRepDataConTy
541
542 pcPrimTyCon0 :: Name -> PrimRep -> TyCon
543 pcPrimTyCon0 name rep
544 = pcPrimTyCon name [] rep
545
546 charPrimTy :: Type
547 charPrimTy = mkTyConTy charPrimTyCon
548 charPrimTyCon :: TyCon
549 charPrimTyCon = pcPrimTyCon0 charPrimTyConName WordRep
550
551 intPrimTy :: Type
552 intPrimTy = mkTyConTy intPrimTyCon
553 intPrimTyCon :: TyCon
554 intPrimTyCon = pcPrimTyCon0 intPrimTyConName IntRep
555
556 int8PrimTy :: Type
557 int8PrimTy = mkTyConTy int8PrimTyCon
558 int8PrimTyCon :: TyCon
559 int8PrimTyCon = pcPrimTyCon0 int8PrimTyConName Int8Rep
560
561 int32PrimTy :: Type
562 int32PrimTy = mkTyConTy int32PrimTyCon
563 int32PrimTyCon :: TyCon
564 int32PrimTyCon = pcPrimTyCon0 int32PrimTyConName IntRep
565
566 int64PrimTy :: Type
567 int64PrimTy = mkTyConTy int64PrimTyCon
568 int64PrimTyCon :: TyCon
569 int64PrimTyCon = pcPrimTyCon0 int64PrimTyConName Int64Rep
570
571 wordPrimTy :: Type
572 wordPrimTy = mkTyConTy wordPrimTyCon
573 wordPrimTyCon :: TyCon
574 wordPrimTyCon = pcPrimTyCon0 wordPrimTyConName WordRep
575
576 word8PrimTy :: Type
577 word8PrimTy = mkTyConTy word8PrimTyCon
578 word8PrimTyCon :: TyCon
579 word8PrimTyCon = pcPrimTyCon0 word8PrimTyConName Word8Rep
580
581 word32PrimTy :: Type
582 word32PrimTy = mkTyConTy word32PrimTyCon
583 word32PrimTyCon :: TyCon
584 word32PrimTyCon = pcPrimTyCon0 word32PrimTyConName WordRep
585
586 word64PrimTy :: Type
587 word64PrimTy = mkTyConTy word64PrimTyCon
588 word64PrimTyCon :: TyCon
589 word64PrimTyCon = pcPrimTyCon0 word64PrimTyConName Word64Rep
590
591 addrPrimTy :: Type
592 addrPrimTy = mkTyConTy addrPrimTyCon
593 addrPrimTyCon :: TyCon
594 addrPrimTyCon = pcPrimTyCon0 addrPrimTyConName AddrRep
595
596 floatPrimTy :: Type
597 floatPrimTy = mkTyConTy floatPrimTyCon
598 floatPrimTyCon :: TyCon
599 floatPrimTyCon = pcPrimTyCon0 floatPrimTyConName FloatRep
600
601 doublePrimTy :: Type
602 doublePrimTy = mkTyConTy doublePrimTyCon
603 doublePrimTyCon :: TyCon
604 doublePrimTyCon = pcPrimTyCon0 doublePrimTyConName DoubleRep
605
606 {-
607 ************************************************************************
608 * *
609 \subsection[TysPrim-state]{The @State#@ type (and @_RealWorld@ types)}
610 * *
611 ************************************************************************
612
613 Note [The equality types story]
614 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
615 GHC sports a veritable menagerie of equality types:
616
617 Type or Lifted? Hetero? Role Built in Defining module
618 class? L/U TyCon
619 -----------------------------------------------------------------------------------------
620 ~# T U hetero nominal eqPrimTyCon GHC.Prim
621 ~~ C L hetero nominal heqTyCon GHC.Types
622 ~ C L homo nominal eqTyCon GHC.Types
623 :~: T L homo nominal (not built-in) Data.Type.Equality
624 :~~: T L hetero nominal (not built-in) Data.Type.Equality
625
626 ~R# T U hetero repr eqReprPrimTy GHC.Prim
627 Coercible C L homo repr coercibleTyCon GHC.Types
628 Coercion T L homo repr (not built-in) Data.Type.Coercion
629 ~P# T U hetero phantom eqPhantPrimTyCon GHC.Prim
630
631 Recall that "hetero" means the equality can related types of different
632 kinds. Knowing that (t1 ~# t2) or (t1 ~R# t2) or even that (t1 ~P# t2)
633 also means that (k1 ~# k2), where (t1 :: k1) and (t2 :: k2).
634
635 To produce less confusion for end users, when not dumping and without
636 -fprint-equality-relations, each of these groups is printed as the bottommost
637 listed equality. That is, (~#) and (~~) are both rendered as (~) in
638 error messages, and (~R#) is rendered as Coercible.
639
640 Let's take these one at a time:
641
642 --------------------------
643 (~#) :: forall k1 k2. k1 -> k2 -> #
644 --------------------------
645 This is The Type Of Equality in GHC. It classifies nominal coercions.
646 This type is used in the solver for recording equality constraints.
647 It responds "yes" to Type.isEqPred and classifies as an EqPred in
648 Type.classifyPredType.
649
650 All wanted constraints of this type are built with coercion holes.
651 (See Note [Coercion holes] in TyCoRep.) But see also
652 Note [Deferred errors for coercion holes] in TcErrors to see how
653 equality constraints are deferred.
654
655 Within GHC, ~# is called eqPrimTyCon, and it is defined in TysPrim.
656
657
658 --------------------------
659 (~~) :: forall k1 k2. k1 -> k2 -> Constraint
660 --------------------------
661 This is (almost) an ordinary class, defined as if by
662 class a ~# b => a ~~ b
663 instance a ~# b => a ~~ b
664 Here's what's unusual about it:
665
666 * We can't actually declare it that way because we don't have syntax for ~#.
667 And ~# isn't a constraint, so even if we could write it, it wouldn't kind
668 check.
669
670 * Users cannot write instances of it.
671
672 * It is "naturally coherent". This means that the solver won't hesitate to
673 solve a goal of type (a ~~ b) even if there is, say (Int ~~ c) in the
674 context. (Normally, it waits to learn more, just in case the given
675 influences what happens next.) See Note [Naturally coherent classes]
676 in TcInteract.
677
678 * It always terminates. That is, in the UndecidableInstances checks, we
679 don't worry if a (~~) constraint is too big, as we know that solving
680 equality terminates.
681
682 On the other hand, this behaves just like any class w.r.t. eager superclass
683 unpacking in the solver. So a lifted equality given quickly becomes an unlifted
684 equality given. This is good, because the solver knows all about unlifted
685 equalities. There is some special-casing in TcInteract.matchClassInst to
686 pretend that there is an instance of this class, as we can't write the instance
687 in Haskell.
688
689 Within GHC, ~~ is called heqTyCon, and it is defined in TysWiredIn.
690
691
692 --------------------------
693 (~) :: forall k. k -> k -> Constraint
694 --------------------------
695 This is /exactly/ like (~~), except with a homogeneous kind.
696 It is an almost-ordinary class defined as if by
697 class a ~# b => (a :: k) ~ (b :: k)
698 instance a ~# b => a ~ b
699
700 * All the bullets for (~~) apply
701
702 * In addition (~) is magical syntax, as ~ is a reserved symbol.
703 It cannot be exported or imported.
704
705 Within GHC, ~ is called eqTyCon, and it is defined in TysWiredIn.
706
707 Historical note: prior to July 18 (~) was defined as a
708 more-ordinary class with (~~) as a superclass. But that made it
709 special in different ways; and the extra superclass selections to
710 get from (~) to (~#) via (~~) were tiresome. Now it's defined
711 uniformly with (~~) and Coercible; much nicer.)
712
713
714 --------------------------
715 (:~:) :: forall k. k -> k -> *
716 (:~~:) :: forall k1 k2. k1 -> k2 -> *
717 --------------------------
718 These are perfectly ordinary GADTs, wrapping (~) and (~~) resp.
719 They are not defined within GHC at all.
720
721
722 --------------------------
723 (~R#) :: forall k1 k2. k1 -> k2 -> #
724 --------------------------
725 The is the representational analogue of ~#. This is the type of representational
726 equalities that the solver works on. All wanted constraints of this type are
727 built with coercion holes.
728
729 Within GHC, ~R# is called eqReprPrimTyCon, and it is defined in TysPrim.
730
731
732 --------------------------
733 Coercible :: forall k. k -> k -> Constraint
734 --------------------------
735 This is quite like (~~) in the way it's defined and treated within GHC, but
736 it's homogeneous. Homogeneity helps with type inference (as GHC can solve one
737 kind from the other) and, in my (Richard's) estimation, will be more intuitive
738 for users.
739
740 An alternative design included HCoercible (like (~~)) and Coercible (like (~)).
741 One annoyance was that we want `coerce :: Coercible a b => a -> b`, and
742 we need the type of coerce to be fully wired-in. So the HCoercible/Coercible
743 split required that both types be fully wired-in. Instead of doing this,
744 I just got rid of HCoercible, as I'm not sure who would use it, anyway.
745
746 Within GHC, Coercible is called coercibleTyCon, and it is defined in
747 TysWiredIn.
748
749
750 --------------------------
751 Coercion :: forall k. k -> k -> *
752 --------------------------
753 This is a perfectly ordinary GADT, wrapping Coercible. It is not defined
754 within GHC at all.
755
756
757 --------------------------
758 (~P#) :: forall k1 k2. k1 -> k2 -> #
759 --------------------------
760 This is the phantom analogue of ~# and it is barely used at all.
761 (The solver has no idea about this one.) Here is the motivation:
762
763 data Phant a = MkPhant
764 type role Phant phantom
765
766 Phant <Int, Bool>_P :: Phant Int ~P# Phant Bool
767
768 We just need to have something to put on that last line. You probably
769 don't need to worry about it.
770
771
772
773 Note [The State# TyCon]
774 ~~~~~~~~~~~~~~~~~~~~~~~
775 State# is the primitive, unlifted type of states. It has one type parameter,
776 thus
777 State# RealWorld
778 or
779 State# s
780
781 where s is a type variable. The only purpose of the type parameter is to
782 keep different state threads separate. It is represented by nothing at all.
783
784 The type parameter to State# is intended to keep separate threads separate.
785 Even though this parameter is not used in the definition of State#, it is
786 given role Nominal to enforce its intended use.
787 -}
788
789 mkStatePrimTy :: Type -> Type
790 mkStatePrimTy ty = TyConApp statePrimTyCon [ty]
791
792 statePrimTyCon :: TyCon -- See Note [The State# TyCon]
793 statePrimTyCon = pcPrimTyCon statePrimTyConName [Nominal] VoidRep
794
795 {-
796 RealWorld is deeply magical. It is *primitive*, but it is not
797 *unlifted* (hence ptrArg). We never manipulate values of type
798 RealWorld; it's only used in the type system, to parameterise State#.
799 -}
800
801 realWorldTyCon :: TyCon
802 realWorldTyCon = mkLiftedPrimTyCon realWorldTyConName [] liftedTypeKind []
803 realWorldTy :: Type
804 realWorldTy = mkTyConTy realWorldTyCon
805 realWorldStatePrimTy :: Type
806 realWorldStatePrimTy = mkStatePrimTy realWorldTy -- State# RealWorld
807
808 -- Note: the ``state-pairing'' types are not truly primitive,
809 -- so they are defined in \tr{TysWiredIn.hs}, not here.
810
811
812 voidPrimTy :: Type
813 voidPrimTy = TyConApp voidPrimTyCon []
814
815 voidPrimTyCon :: TyCon
816 voidPrimTyCon = pcPrimTyCon voidPrimTyConName [] VoidRep
817
818 mkProxyPrimTy :: Type -> Type -> Type
819 mkProxyPrimTy k ty = TyConApp proxyPrimTyCon [k, ty]
820
821 proxyPrimTyCon :: TyCon
822 proxyPrimTyCon = mkPrimTyCon proxyPrimTyConName binders res_kind [Nominal,Nominal]
823 where
824 -- Kind: forall k. k -> Void#
825 binders = mkTemplateTyConBinders [liftedTypeKind] (\ks-> ks)
826 res_kind = unboxedTupleKind []
827
828
829 {- *********************************************************************
830 * *
831 Primitive equality constraints
832 See Note [The equality types story]
833 * *
834 ********************************************************************* -}
835
836 eqPrimTyCon :: TyCon -- The representation type for equality predicates
837 -- See Note [The equality types story]
838 eqPrimTyCon = mkPrimTyCon eqPrimTyConName binders res_kind roles
839 where
840 -- Kind :: forall k1 k2. k1 -> k2 -> Void#
841 binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] (\ks -> ks)
842 res_kind = unboxedTupleKind []
843 roles = [Nominal, Nominal, Nominal, Nominal]
844
845 -- like eqPrimTyCon, but the type for *Representational* coercions
846 -- this should only ever appear as the type of a covar. Its role is
847 -- interpreted in coercionRole
848 eqReprPrimTyCon :: TyCon -- See Note [The equality types story]
849 eqReprPrimTyCon = mkPrimTyCon eqReprPrimTyConName binders res_kind roles
850 where
851 -- Kind :: forall k1 k2. k1 -> k2 -> Void#
852 binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] (\ks -> ks)
853 res_kind = unboxedTupleKind []
854 roles = [Nominal, Nominal, Representational, Representational]
855
856 -- like eqPrimTyCon, but the type for *Phantom* coercions.
857 -- This is only used to make higher-order equalities. Nothing
858 -- should ever actually have this type!
859 eqPhantPrimTyCon :: TyCon
860 eqPhantPrimTyCon = mkPrimTyCon eqPhantPrimTyConName binders res_kind roles
861 where
862 -- Kind :: forall k1 k2. k1 -> k2 -> Void#
863 binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] (\ks -> ks)
864 res_kind = unboxedTupleKind []
865 roles = [Nominal, Nominal, Phantom, Phantom]
866
867 {- *********************************************************************
868 * *
869 The primitive array types
870 * *
871 ********************************************************************* -}
872
873 arrayPrimTyCon, mutableArrayPrimTyCon, mutableByteArrayPrimTyCon,
874 byteArrayPrimTyCon, arrayArrayPrimTyCon, mutableArrayArrayPrimTyCon,
875 smallArrayPrimTyCon, smallMutableArrayPrimTyCon :: TyCon
876 arrayPrimTyCon = pcPrimTyCon arrayPrimTyConName [Representational] UnliftedRep
877 mutableArrayPrimTyCon = pcPrimTyCon mutableArrayPrimTyConName [Nominal, Representational] UnliftedRep
878 mutableByteArrayPrimTyCon = pcPrimTyCon mutableByteArrayPrimTyConName [Nominal] UnliftedRep
879 byteArrayPrimTyCon = pcPrimTyCon0 byteArrayPrimTyConName UnliftedRep
880 arrayArrayPrimTyCon = pcPrimTyCon0 arrayArrayPrimTyConName UnliftedRep
881 mutableArrayArrayPrimTyCon = pcPrimTyCon mutableArrayArrayPrimTyConName [Nominal] UnliftedRep
882 smallArrayPrimTyCon = pcPrimTyCon smallArrayPrimTyConName [Representational] UnliftedRep
883 smallMutableArrayPrimTyCon = pcPrimTyCon smallMutableArrayPrimTyConName [Nominal, Representational] UnliftedRep
884
885 mkArrayPrimTy :: Type -> Type
886 mkArrayPrimTy elt = TyConApp arrayPrimTyCon [elt]
887 byteArrayPrimTy :: Type
888 byteArrayPrimTy = mkTyConTy byteArrayPrimTyCon
889 mkArrayArrayPrimTy :: Type
890 mkArrayArrayPrimTy = mkTyConTy arrayArrayPrimTyCon
891 mkSmallArrayPrimTy :: Type -> Type
892 mkSmallArrayPrimTy elt = TyConApp smallArrayPrimTyCon [elt]
893 mkMutableArrayPrimTy :: Type -> Type -> Type
894 mkMutableArrayPrimTy s elt = TyConApp mutableArrayPrimTyCon [s, elt]
895 mkMutableByteArrayPrimTy :: Type -> Type
896 mkMutableByteArrayPrimTy s = TyConApp mutableByteArrayPrimTyCon [s]
897 mkMutableArrayArrayPrimTy :: Type -> Type
898 mkMutableArrayArrayPrimTy s = TyConApp mutableArrayArrayPrimTyCon [s]
899 mkSmallMutableArrayPrimTy :: Type -> Type -> Type
900 mkSmallMutableArrayPrimTy s elt = TyConApp smallMutableArrayPrimTyCon [s, elt]
901
902
903 {- *********************************************************************
904 * *
905 The mutable variable type
906 * *
907 ********************************************************************* -}
908
909 mutVarPrimTyCon :: TyCon
910 mutVarPrimTyCon = pcPrimTyCon mutVarPrimTyConName [Nominal, Representational] UnliftedRep
911
912 mkMutVarPrimTy :: Type -> Type -> Type
913 mkMutVarPrimTy s elt = TyConApp mutVarPrimTyCon [s, elt]
914
915 {-
916 ************************************************************************
917 * *
918 \subsection[TysPrim-synch-var]{The synchronizing variable type}
919 * *
920 ************************************************************************
921 -}
922
923 mVarPrimTyCon :: TyCon
924 mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName [Nominal, Representational] UnliftedRep
925
926 mkMVarPrimTy :: Type -> Type -> Type
927 mkMVarPrimTy s elt = TyConApp mVarPrimTyCon [s, elt]
928
929 {-
930 ************************************************************************
931 * *
932 \subsection[TysPrim-stm-var]{The transactional variable type}
933 * *
934 ************************************************************************
935 -}
936
937 tVarPrimTyCon :: TyCon
938 tVarPrimTyCon = pcPrimTyCon tVarPrimTyConName [Nominal, Representational] UnliftedRep
939
940 mkTVarPrimTy :: Type -> Type -> Type
941 mkTVarPrimTy s elt = TyConApp tVarPrimTyCon [s, elt]
942
943 {-
944 ************************************************************************
945 * *
946 \subsection[TysPrim-stable-ptrs]{The stable-pointer type}
947 * *
948 ************************************************************************
949 -}
950
951 stablePtrPrimTyCon :: TyCon
952 stablePtrPrimTyCon = pcPrimTyCon stablePtrPrimTyConName [Representational] AddrRep
953
954 mkStablePtrPrimTy :: Type -> Type
955 mkStablePtrPrimTy ty = TyConApp stablePtrPrimTyCon [ty]
956
957 {-
958 ************************************************************************
959 * *
960 \subsection[TysPrim-stable-names]{The stable-name type}
961 * *
962 ************************************************************************
963 -}
964
965 stableNamePrimTyCon :: TyCon
966 stableNamePrimTyCon = pcPrimTyCon stableNamePrimTyConName [Phantom] UnliftedRep
967
968 mkStableNamePrimTy :: Type -> Type
969 mkStableNamePrimTy ty = TyConApp stableNamePrimTyCon [ty]
970
971 {-
972 ************************************************************************
973 * *
974 \subsection[TysPrim-compact-nfdata]{The Compact NFData (CNF) type}
975 * *
976 ************************************************************************
977 -}
978
979 compactPrimTyCon :: TyCon
980 compactPrimTyCon = pcPrimTyCon0 compactPrimTyConName UnliftedRep
981
982 compactPrimTy :: Type
983 compactPrimTy = mkTyConTy compactPrimTyCon
984
985 {-
986 ************************************************************************
987 * *
988 \subsection[TysPrim-BCOs]{The ``bytecode object'' type}
989 * *
990 ************************************************************************
991 -}
992
993 bcoPrimTy :: Type
994 bcoPrimTy = mkTyConTy bcoPrimTyCon
995 bcoPrimTyCon :: TyCon
996 bcoPrimTyCon = pcPrimTyCon0 bcoPrimTyConName UnliftedRep
997
998 {-
999 ************************************************************************
1000 * *
1001 \subsection[TysPrim-Weak]{The ``weak pointer'' type}
1002 * *
1003 ************************************************************************
1004 -}
1005
1006 weakPrimTyCon :: TyCon
1007 weakPrimTyCon = pcPrimTyCon weakPrimTyConName [Representational] UnliftedRep
1008
1009 mkWeakPrimTy :: Type -> Type
1010 mkWeakPrimTy v = TyConApp weakPrimTyCon [v]
1011
1012 {-
1013 ************************************************************************
1014 * *
1015 \subsection[TysPrim-thread-ids]{The ``thread id'' type}
1016 * *
1017 ************************************************************************
1018
1019 A thread id is represented by a pointer to the TSO itself, to ensure
1020 that they are always unique and we can always find the TSO for a given
1021 thread id. However, this has the unfortunate consequence that a
1022 ThreadId# for a given thread is treated as a root by the garbage
1023 collector and can keep TSOs around for too long.
1024
1025 Hence the programmer API for thread manipulation uses a weak pointer
1026 to the thread id internally.
1027 -}
1028
1029 threadIdPrimTy :: Type
1030 threadIdPrimTy = mkTyConTy threadIdPrimTyCon
1031 threadIdPrimTyCon :: TyCon
1032 threadIdPrimTyCon = pcPrimTyCon0 threadIdPrimTyConName UnliftedRep
1033
1034 {-
1035 ************************************************************************
1036 * *
1037 \subsection{SIMD vector types}
1038 * *
1039 ************************************************************************
1040 -}
1041
1042 #include "primop-vector-tys.hs-incl"