2 Builtins(..), sumTyCon, prodTyCon, prodDataCon,
3 selTy, selReplicate, selPick, selTags, selElements,
4 combinePDVar, scalarZip, closureCtrFun,
5 initBuiltins, initBuiltinVars, initBuiltinTyCons, initBuiltinDataCons,
6 initBuiltinPAs, initBuiltinPRs,
7 initBuiltinBoxedTyCons, initBuiltinScalars,
13 import IfaceEnv ( lookupOrig )
17 import DataCon ( DataCon, dataConName, dataConWorkId )
18 import TyCon ( TyCon, tyConName, tyConDataCons )
19 import Class ( Class, classTyCon )
20 import CoreSyn ( CoreExpr, Expr(..) )
22 import Id ( mkSysLocal )
23 import Name ( Name, getOccString )
27 import TypeRep ( funTyCon )
28 import Type ( Type, mkTyConApp )
30 import TysWiredIn ( unitDataCon,
34 boolTyCon, trueDataCon, falseDataCon,
36 import PrelNames ( word8TyConName, gHC_PARR )
37 import BasicTypes ( Boxity(..) )
43 import Control.Monad ( liftM, zipWithM )
44 import Data.List ( unzip4 )
52 mAX_DPH_COMBINE :: Int
55 mAX_DPH_SCALAR_ARGS :: Int
56 mAX_DPH_SCALAR_ARGS = 3
58 data Modules = Modules {
61 , dph_Closure :: Module
62 , dph_Unboxed :: Module
63 , dph_Instances :: Module
64 , dph_Combinators :: Module
65 , dph_Scalar :: Module
66 , dph_Selector :: Module
67 , dph_Prelude_PArr :: Module
68 , dph_Prelude_Int :: Module
69 , dph_Prelude_Word8 :: Module
70 , dph_Prelude_Double :: Module
71 , dph_Prelude_Bool :: Module
72 , dph_Prelude_Tuple :: Module
75 dph_Modules :: PackageId -> Modules
76 dph_Modules pkg = Modules {
77 dph_PArray = mk (fsLit "Data.Array.Parallel.Lifted.PArray")
78 , dph_Repr = mk (fsLit "Data.Array.Parallel.Lifted.Repr")
79 , dph_Closure = mk (fsLit "Data.Array.Parallel.Lifted.Closure")
80 , dph_Unboxed = mk (fsLit "Data.Array.Parallel.Lifted.Unboxed")
81 , dph_Instances = mk (fsLit "Data.Array.Parallel.Lifted.Instances")
82 , dph_Combinators = mk (fsLit "Data.Array.Parallel.Lifted.Combinators")
83 , dph_Scalar = mk (fsLit "Data.Array.Parallel.Lifted.Scalar")
84 , dph_Selector = mk (fsLit "Data.Array.Parallel.Lifted.Selector")
86 , dph_Prelude_PArr = mk (fsLit "Data.Array.Parallel.Prelude.Base.PArr")
87 , dph_Prelude_Int = mk (fsLit "Data.Array.Parallel.Prelude.Base.Int")
88 , dph_Prelude_Word8 = mk (fsLit "Data.Array.Parallel.Prelude.Base.Word8")
89 , dph_Prelude_Double = mk (fsLit "Data.Array.Parallel.Prelude.Base.Double")
90 , dph_Prelude_Bool = mk (fsLit "Data.Array.Parallel.Prelude.Base.Bool")
91 , dph_Prelude_Tuple = mk (fsLit "Data.Array.Parallel.Prelude.Base.Tuple")
94 mk = mkModule pkg . mkModuleNameFS
96 dph_Orphans :: [Modules -> Module]
97 dph_Orphans = [dph_Repr, dph_Instances]
99 data Builtins = Builtins {
100 dphModules :: Modules
101 , parrayTyCon :: TyCon
102 , parrayDataCon :: DataCon
103 , pdataTyCon :: TyCon
105 , paDataCon :: DataCon
106 , preprTyCon :: TyCon
108 , prDataCon :: DataCon
111 , selTys :: Array Int Type
112 , selReplicates :: Array Int CoreExpr
113 , selPicks :: Array Int CoreExpr
114 , selTagss :: Array Int CoreExpr
115 , selEls :: Array (Int, Int) CoreExpr
116 , sumTyCons :: Array Int TyCon
117 , closureTyCon :: TyCon
124 , liftedClosureVar :: Var
125 , liftedApplyVar :: Var
126 , replicatePDVar :: Var
129 , packByTagPDVar :: Var
130 , combinePDVars :: Array Int Var
131 , scalarClass :: Class
132 , scalarZips :: Array Int Var
133 , closureCtrFuns :: Array Int Var
134 , liftingContext :: Var
137 indexBuiltin :: (Ix i, Outputable i) => String -> (Builtins -> Array i a)
138 -> i -> Builtins -> a
139 indexBuiltin fn f i bi
140 | inRange (bounds xs) i = xs ! i
141 | otherwise = pprPanic fn (ppr i)
145 selTy :: Int -> Builtins -> Type
146 selTy = indexBuiltin "selTy" selTys
148 selReplicate :: Int -> Builtins -> CoreExpr
149 selReplicate = indexBuiltin "selReplicate" selReplicates
151 selPick :: Int -> Builtins -> CoreExpr
152 selPick = indexBuiltin "selPick" selPicks
154 selTags :: Int -> Builtins -> CoreExpr
155 selTags = indexBuiltin "selTags" selTagss
157 selElements :: Int -> Int -> Builtins -> CoreExpr
158 selElements i j = indexBuiltin "selElements" selEls (i,j)
160 sumTyCon :: Int -> Builtins -> TyCon
161 sumTyCon = indexBuiltin "sumTyCon" sumTyCons
163 prodTyCon :: Int -> Builtins -> TyCon
165 | n >= 2 && n <= mAX_DPH_PROD = tupleTyCon Boxed n
166 | otherwise = pprPanic "prodTyCon" (ppr n)
168 prodDataCon :: Int -> Builtins -> DataCon
169 prodDataCon n bi = case tyConDataCons (prodTyCon n bi) of
171 _ -> pprPanic "prodDataCon" (ppr n)
173 combinePDVar :: Int -> Builtins -> Var
174 combinePDVar = indexBuiltin "combinePDVar" combinePDVars
176 scalarZip :: Int -> Builtins -> Var
177 scalarZip = indexBuiltin "scalarZip" scalarZips
179 closureCtrFun :: Int -> Builtins -> Var
180 closureCtrFun = indexBuiltin "closureCtrFun" closureCtrFuns
182 initBuiltins :: PackageId -> DsM Builtins
185 mapM_ load dph_Orphans
186 parrayTyCon <- externalTyCon dph_PArray (fsLit "PArray")
187 let [parrayDataCon] = tyConDataCons parrayTyCon
188 pdataTyCon <- externalTyCon dph_PArray (fsLit "PData")
189 paTyCon <- externalClassTyCon dph_PArray (fsLit "PA")
190 let [paDataCon] = tyConDataCons paTyCon
191 preprTyCon <- externalTyCon dph_PArray (fsLit "PRepr")
192 prTyCon <- externalClassTyCon dph_PArray (fsLit "PR")
193 let [prDataCon] = tyConDataCons prTyCon
194 closureTyCon <- externalTyCon dph_Closure (fsLit ":->")
196 voidTyCon <- externalTyCon dph_Repr (fsLit "Void")
197 wrapTyCon <- externalTyCon dph_Repr (fsLit "Wrap")
198 sel_tys <- mapM (externalType dph_Selector)
199 (numbered "Sel" 2 mAX_DPH_SUM)
200 sel_replicates <- mapM (externalFun dph_Selector)
201 (numbered "replicate" 2 mAX_DPH_SUM)
202 sel_picks <- mapM (externalFun dph_Selector)
203 (numbered "pick" 2 mAX_DPH_SUM)
204 sel_tags <- mapM (externalFun dph_Selector)
205 (numbered "tagsSel" 2 mAX_DPH_SUM)
206 sel_els <- mapM mk_elements
207 [(i,j) | i <- [2..mAX_DPH_SUM], j <- [0..i-1]]
208 sum_tcs <- mapM (externalTyCon dph_Repr)
209 (numbered "Sum" 2 mAX_DPH_SUM)
211 let selTys = listArray (2, mAX_DPH_SUM) sel_tys
212 selReplicates = listArray (2, mAX_DPH_SUM) sel_replicates
213 selPicks = listArray (2, mAX_DPH_SUM) sel_picks
214 selTagss = listArray (2, mAX_DPH_SUM) sel_tags
215 selEls = array ((2,0), (mAX_DPH_SUM, mAX_DPH_SUM)) sel_els
216 sumTyCons = listArray (2, mAX_DPH_SUM) sum_tcs
218 voidVar <- externalVar dph_Repr (fsLit "void")
219 pvoidVar <- externalVar dph_Repr (fsLit "pvoid")
220 fromVoidVar <- externalVar dph_Repr (fsLit "fromVoid")
221 punitVar <- externalVar dph_Repr (fsLit "punit")
222 closureVar <- externalVar dph_Closure (fsLit "closure")
223 applyVar <- externalVar dph_Closure (fsLit "$:")
224 liftedClosureVar <- externalVar dph_Closure (fsLit "liftedClosure")
225 liftedApplyVar <- externalVar dph_Closure (fsLit "liftedApply")
226 replicatePDVar <- externalVar dph_PArray (fsLit "replicatePD")
227 emptyPDVar <- externalVar dph_PArray (fsLit "emptyPD")
228 packPDVar <- externalVar dph_PArray (fsLit "packPD")
229 packByTagPDVar <- externalVar dph_PArray (fsLit "packByTagPD")
231 combines <- mapM (externalVar dph_PArray)
232 [mkFastString ("combine" ++ show i ++ "PD")
233 | i <- [2..mAX_DPH_COMBINE]]
234 let combinePDVars = listArray (2, mAX_DPH_COMBINE) combines
236 scalarClass <- externalClass dph_Scalar (fsLit "Scalar")
237 scalar_map <- externalVar dph_Scalar (fsLit "scalar_map")
238 scalar_zip2 <- externalVar dph_Scalar (fsLit "scalar_zipWith")
239 scalar_zips <- mapM (externalVar dph_Scalar)
240 (numbered "scalar_zipWith" 3 mAX_DPH_SCALAR_ARGS)
241 let scalarZips = listArray (1, mAX_DPH_SCALAR_ARGS)
242 (scalar_map : scalar_zip2 : scalar_zips)
243 closures <- mapM (externalVar dph_Closure)
244 (numbered "closure" 1 mAX_DPH_SCALAR_ARGS)
245 let closureCtrFuns = listArray (1, mAX_DPH_COMBINE) closures
247 liftingContext <- liftM (\u -> mkSysLocal (fsLit "lc") u intPrimTy)
252 , parrayTyCon = parrayTyCon
253 , parrayDataCon = parrayDataCon
254 , pdataTyCon = pdataTyCon
256 , paDataCon = paDataCon
257 , preprTyCon = preprTyCon
259 , prDataCon = prDataCon
260 , voidTyCon = voidTyCon
261 , wrapTyCon = wrapTyCon
263 , selReplicates = selReplicates
264 , selPicks = selPicks
265 , selTagss = selTagss
267 , sumTyCons = sumTyCons
268 , closureTyCon = closureTyCon
270 , pvoidVar = pvoidVar
271 , fromVoidVar = fromVoidVar
272 , punitVar = punitVar
273 , closureVar = closureVar
274 , applyVar = applyVar
275 , liftedClosureVar = liftedClosureVar
276 , liftedApplyVar = liftedApplyVar
277 , replicatePDVar = replicatePDVar
278 , emptyPDVar = emptyPDVar
279 , packPDVar = packPDVar
280 , packByTagPDVar = packByTagPDVar
281 , combinePDVars = combinePDVars
282 , scalarClass = scalarClass
283 , scalarZips = scalarZips
284 , closureCtrFuns = closureCtrFuns
285 , liftingContext = liftingContext
289 dph_PArray = dph_PArray
290 , dph_Repr = dph_Repr
291 , dph_Closure = dph_Closure
292 , dph_Selector = dph_Selector
293 , dph_Scalar = dph_Scalar
297 load get_mod = dsLoadModule doc mod
299 mod = get_mod modules
300 doc = ppr mod <+> ptext (sLit "is a DPH module")
302 numbered :: String -> Int -> Int -> [FastString]
303 numbered pfx m n = [mkFastString (pfx ++ show i) | i <- [m..n]]
305 mk_elements :: (Int, Int) -> DsM ((Int, Int), CoreExpr)
308 v <- externalVar dph_Selector
309 $ mkFastString ("elementsSel" ++ show i ++ "_" ++ show j ++ "#")
310 return ((i,j), Var v)
313 initBuiltinVars :: Builtins -> DsM [(Var, Var)]
314 initBuiltinVars (Builtins { dphModules = mods })
316 uvars <- zipWithM externalVar umods ufs
317 vvars <- zipWithM externalVar vmods vfs
318 cvars <- zipWithM externalVar cmods cfs
319 return $ [(v,v) | v <- map dataConWorkId defaultDataConWorkers]
320 ++ zip (map dataConWorkId cons) cvars
323 (umods, ufs, vmods, vfs) = unzip4 (preludeVars mods)
325 (cons, cmods, cfs) = unzip3 (preludeDataCons mods)
327 defaultDataConWorkers :: [DataCon]
328 defaultDataConWorkers = [trueDataCon, falseDataCon, unitDataCon]
330 preludeDataCons :: Modules -> [(DataCon, Module, FastString)]
331 preludeDataCons (Modules { dph_Prelude_Tuple = dph_Prelude_Tuple })
332 = [mk_tup n dph_Prelude_Tuple (mkFastString $ "tup" ++ show n) | n <- [2..3]]
334 mk_tup n mod name = (tupleCon Boxed n, mod, name)
336 preludeVars :: Modules -> [(Module, FastString, Module, FastString)]
337 preludeVars (Modules { dph_Combinators = dph_Combinators
338 , dph_PArray = dph_PArray
339 , dph_Prelude_Int = dph_Prelude_Int
340 , dph_Prelude_Word8 = dph_Prelude_Word8
341 , dph_Prelude_Double = dph_Prelude_Double
342 , dph_Prelude_Bool = dph_Prelude_Bool
343 , dph_Prelude_PArr = dph_Prelude_PArr
346 mk gHC_PARR (fsLit "mapP") dph_Combinators (fsLit "mapPA")
347 , mk gHC_PARR (fsLit "zipWithP") dph_Combinators (fsLit "zipWithPA")
348 , mk gHC_PARR (fsLit "zipP") dph_Combinators (fsLit "zipPA")
349 , mk gHC_PARR (fsLit "unzipP") dph_Combinators (fsLit "unzipPA")
350 , mk gHC_PARR (fsLit "filterP") dph_Combinators (fsLit "filterPA")
351 , mk gHC_PARR (fsLit "lengthP") dph_Combinators (fsLit "lengthPA")
352 , mk gHC_PARR (fsLit "replicateP") dph_Combinators (fsLit "replicatePA")
353 , mk gHC_PARR (fsLit "!:") dph_Combinators (fsLit "indexPA")
354 , mk gHC_PARR (fsLit "crossMapP") dph_Combinators (fsLit "crossMapPA")
355 , mk gHC_PARR (fsLit "singletonP") dph_Combinators (fsLit "singletonPA")
356 , mk gHC_PARR (fsLit "concatP") dph_Combinators (fsLit "concatPA")
357 , mk gHC_PARR (fsLit "+:+") dph_Combinators (fsLit "appPA")
358 , mk gHC_PARR (fsLit "emptyP") dph_PArray (fsLit "emptyPA")
360 , mk' dph_Prelude_Int "div" "divV"
361 , mk' dph_Prelude_Int "mod" "modV"
362 , mk' dph_Prelude_Int "sqrt" "sqrtV"
363 , mk' dph_Prelude_Int "enumFromToP" "enumFromToPA"
364 -- , mk' dph_Prelude_Int "upToP" "upToPA"
366 ++ vars_Ord dph_Prelude_Int
367 ++ vars_Num dph_Prelude_Int
369 ++ vars_Ord dph_Prelude_Word8
370 ++ vars_Num dph_Prelude_Word8
372 [ mk' dph_Prelude_Word8 "div" "divV"
373 , mk' dph_Prelude_Word8 "mod" "modV"
374 , mk' dph_Prelude_Word8 "fromInt" "fromIntV"
375 , mk' dph_Prelude_Word8 "toInt" "toIntV"
378 ++ vars_Ord dph_Prelude_Double
379 ++ vars_Num dph_Prelude_Double
380 ++ vars_Fractional dph_Prelude_Double
381 ++ vars_Floating dph_Prelude_Double
382 ++ vars_RealFrac dph_Prelude_Double
384 [ mk dph_Prelude_Bool (fsLit "andP") dph_Prelude_Bool (fsLit "andPA")
385 , mk dph_Prelude_Bool (fsLit "orP") dph_Prelude_Bool (fsLit "orPA")
388 , mk dph_Prelude_PArr (fsLit "fromPArrayP") dph_Prelude_PArr (fsLit "fromPArrayPA")
389 , mk dph_Prelude_PArr (fsLit "toPArrayP") dph_Prelude_PArr (fsLit "toPArrayPA")
390 , mk dph_Prelude_PArr (fsLit "fromNestedPArrayP") dph_Prelude_PArr (fsLit "fromNestedPArrayPA")
391 , mk dph_Prelude_PArr (fsLit "combineP") dph_Combinators (fsLit "combine2PA")
395 mk' mod v v' = mk mod (fsLit v) mod (fsLit v')
397 vars_Ord mod = [mk' mod "==" "eqV"
403 ,mk' mod "min" "minV"
404 ,mk' mod "max" "maxV"
405 ,mk' mod "minimumP" "minimumPA"
406 ,mk' mod "maximumP" "maximumPA"
407 ,mk' mod "minIndexP" "minIndexPA"
408 ,mk' mod "maxIndexP" "maxIndexPA"
411 vars_Num mod = [mk' mod "+" "plusV"
412 ,mk' mod "-" "minusV"
414 ,mk' mod "negate" "negateV"
415 ,mk' mod "abs" "absV"
416 ,mk' mod "sumP" "sumPA"
417 ,mk' mod "productP" "productPA"
420 vars_Fractional mod = [mk' mod "/" "divideV"
421 ,mk' mod "recip" "recipV"
424 vars_Floating mod = [mk' mod "pi" "pi"
425 ,mk' mod "exp" "expV"
426 ,mk' mod "sqrt" "sqrtV"
427 ,mk' mod "log" "logV"
428 ,mk' mod "sin" "sinV"
429 ,mk' mod "tan" "tanV"
430 ,mk' mod "cos" "cosV"
431 ,mk' mod "asin" "asinV"
432 ,mk' mod "atan" "atanV"
433 ,mk' mod "acos" "acosV"
434 ,mk' mod "sinh" "sinhV"
435 ,mk' mod "tanh" "tanhV"
436 ,mk' mod "cosh" "coshV"
437 ,mk' mod "asinh" "asinhV"
438 ,mk' mod "atanh" "atanhV"
439 ,mk' mod "acosh" "acoshV"
441 ,mk' mod "logBase" "logBaseV"
444 vars_RealFrac mod = [mk' mod "fromInt" "fromIntV"
445 ,mk' mod "truncate" "truncateV"
446 ,mk' mod "round" "roundV"
447 ,mk' mod "ceiling" "ceilingV"
448 ,mk' mod "floor" "floorV"
451 initBuiltinTyCons :: Builtins -> DsM [(Name, TyCon)]
454 -- parr <- externalTyCon dph_Prelude_PArr (fsLit "PArr")
455 dft_tcs <- defaultTyCons
456 return $ (tyConName funTyCon, closureTyCon bi)
457 : (parrTyConName, parrayTyCon bi)
460 : (tyConName $ parrayTyCon bi, parrayTyCon bi)
462 : [(tyConName tc, tc) | tc <- dft_tcs]
464 defaultTyCons :: DsM [TyCon]
467 word8 <- dsLookupTyCon word8TyConName
468 return [intTyCon, boolTyCon, doubleTyCon, word8]
470 initBuiltinDataCons :: Builtins -> [(Name, DataCon)]
471 initBuiltinDataCons _ = [(dataConName dc, dc)| dc <- defaultDataCons]
473 defaultDataCons :: [DataCon]
474 defaultDataCons = [trueDataCon, falseDataCon, unitDataCon]
476 initBuiltinPAs :: Builtins -> (InstEnv, InstEnv) -> DsM [(Name, Var)]
477 initBuiltinPAs (Builtins { dphModules = mods }) insts
478 = liftM (initBuiltinDicts insts) (externalClass (dph_PArray mods) (fsLit "PA"))
480 initBuiltinPRs :: Builtins -> (InstEnv, InstEnv) -> DsM [(Name, Var)]
481 initBuiltinPRs (Builtins { dphModules = mods }) insts
482 = liftM (initBuiltinDicts insts) (externalClass (dph_PArray mods) (fsLit "PR"))
484 initBuiltinDicts :: (InstEnv, InstEnv) -> Class -> [(Name, Var)]
485 initBuiltinDicts insts cls = map find $ classInstances insts cls
487 find i | [Just tc] <- instanceRoughTcs i = (tc, instanceDFunId i)
488 | otherwise = pprPanic "Invalid DPH instance" (ppr i)
490 initBuiltinBoxedTyCons :: Builtins -> DsM [(Name, TyCon)]
491 initBuiltinBoxedTyCons = return . builtinBoxedTyCons
493 builtinBoxedTyCons :: Builtins -> [(Name, TyCon)]
494 builtinBoxedTyCons _ =
495 [(tyConName intPrimTyCon, intTyCon)]
498 initBuiltinScalars :: Builtins -> DsM [Var]
499 initBuiltinScalars bi
500 = mapM (uncurry externalVar) (preludeScalars $ dphModules bi)
503 preludeScalars :: Modules -> [(Module, FastString)]
504 preludeScalars (Modules { dph_Prelude_Int = dph_Prelude_Int
505 , dph_Prelude_Word8 = dph_Prelude_Word8
506 , dph_Prelude_Double = dph_Prelude_Double
509 mk dph_Prelude_Int "div"
510 , mk dph_Prelude_Int "mod"
511 , mk dph_Prelude_Int "sqrt"
513 ++ scalars_Ord dph_Prelude_Int
514 ++ scalars_Num dph_Prelude_Int
516 ++ scalars_Ord dph_Prelude_Word8
517 ++ scalars_Num dph_Prelude_Word8
519 [ mk dph_Prelude_Word8 "div"
520 , mk dph_Prelude_Word8 "mod"
521 , mk dph_Prelude_Word8 "fromInt"
522 , mk dph_Prelude_Word8 "toInt"
525 ++ scalars_Ord dph_Prelude_Double
526 ++ scalars_Num dph_Prelude_Double
527 ++ scalars_Fractional dph_Prelude_Double
528 ++ scalars_Floating dph_Prelude_Double
529 ++ scalars_RealFrac dph_Prelude_Double
531 mk mod s = (mod, fsLit s)
533 scalars_Ord mod = [mk mod "=="
543 scalars_Num mod = [mk mod "+"
550 scalars_Fractional mod = [mk mod "/"
554 scalars_Floating mod = [mk mod "pi"
574 scalars_RealFrac mod = [mk mod "fromInt"
582 externalVar :: Module -> FastString -> DsM Var
584 = dsLookupGlobalId =<< lookupOrig mod (mkVarOccFS fs)
586 externalFun :: Module -> FastString -> DsM CoreExpr
589 var <- externalVar mod fs
592 externalTyCon :: Module -> FastString -> DsM TyCon
594 = dsLookupTyCon =<< lookupOrig mod (mkTcOccFS fs)
596 externalClassTyCon :: Module -> FastString -> DsM TyCon
597 externalClassTyCon mod fs = liftM classTyCon (externalClass mod fs)
599 externalType :: Module -> FastString -> DsM Type
602 tycon <- externalTyCon mod fs
603 return $ mkTyConApp tycon []
605 externalClass :: Module -> FastString -> DsM Class
607 = dsLookupClass =<< lookupOrig mod (mkClsOccFS fs)
609 primMethod :: TyCon -> String -> Builtins -> DsM (Maybe Var)
610 primMethod tycon method (Builtins { dphModules = mods })
611 | Just suffix <- lookupNameEnv prim_ty_cons (tyConName tycon)
613 $ dsLookupGlobalId =<< lookupOrig (dph_Unboxed mods)
614 (mkVarOcc $ method ++ suffix)
616 | otherwise = return Nothing
618 primPArray :: TyCon -> Builtins -> DsM (Maybe TyCon)
619 primPArray tycon (Builtins { dphModules = mods })
620 | Just suffix <- lookupNameEnv prim_ty_cons (tyConName tycon)
622 $ dsLookupTyCon =<< lookupOrig (dph_Unboxed mods)
623 (mkTcOcc $ "PArray" ++ suffix)
625 | otherwise = return Nothing
627 prim_ty_cons :: NameEnv String
628 prim_ty_cons = mkNameEnv [mk_prim intPrimTyCon]
630 mk_prim tycon = (tyConName tycon, '_' : getOccString tycon)