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