+%************************************************************************
+%* *
+\subsection{Export lists for pseudo-modules (GHC.Prim)}
+%* *
+%************************************************************************
+
+GHC.Prim "exports" all the primops and primitive types, some
+wired-in Ids, and the CCallable & CReturnable classes.
+
+\begin{code}
+ghcPrimExports :: [RdrAvailInfo]
+ = AvailTC cCallableOcc [ cCallableOcc ] :
+ AvailTC cReturnableOcc [ cReturnableOcc ] :
+ Avail (nameOccName assertName) : -- doesn't have an Id
+ map (Avail . nameOccName . idName) ghcPrimIds ++
+ map (Avail . primOpOcc) allThePrimOps ++
+ [ AvailTC occ [occ] |
+ n <- funTyCon : primTyCons, let occ = nameOccName (tyConName n)
+ ]
+ where
+ cCallableOcc = nameOccName cCallableClassName
+ cReturnableOcc = nameOccName cReturnableClassName
+
+assertDecl
+ = IfaceSig {
+ tcdName = nameRdrName assertName,
+ tcdType = HsForAllTy (Just [liftedAlpha]) [] (HsTyVar alpha),
+ tcdIdInfo = [],
+ tcdLoc = noSrcLoc
+ }
+
+cCallableClassDecl
+ = mkClassDecl
+ ([], nameRdrName cCallableClassName, [openAlpha])
+ [] -- no fds
+ [] -- no sigs
+ Nothing -- no mbinds
+ noSrcLoc
+
+cReturnableClassDecl
+ = mkClassDecl
+ ([], nameRdrName cReturnableClassName, [openAlpha])
+ [] -- no fds
+ [] -- no sigs
+ Nothing -- no mbinds
+ noSrcLoc
+
+alpha = mkRdrUnqual (mkVarOcc FSLIT("a"))
+openAlpha = IfaceTyVar alpha openTypeKind
+liftedAlpha = IfaceTyVar alpha liftedTypeKind
+\end{code}