link.h 3.82 KB
Newer Older
1

2
extern Cell conCons;
3

4 5
extern Name nameShow;
extern Name namePutStr;
6
extern Name nameRunIO_toplevel;
7

8

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/* The following data constructors are used to box unboxed
 * arguments and are treated differently by the code generator.
 * That is, they have primop `elem` {INT_REP,FLOAT_REP,...}.
 */
#define boxingConRep(con) ((AsmRep)(name(con).primop))
#define isBoxingCon(con) (isName(con) && boxingConRep(con) != 0)

extern Name nameMkC;
extern Name nameMkI;
extern Name nameMkW;
extern Name nameMkA;
extern Name nameMkF;
extern Name nameMkD;
extern Name nameMkStable;    

/* The following data constructors are used to make boxed but 
 * unpointed values pointed and require no special treatment
 * by the code generator.
 */
extern Name nameMkInteger;
extern Name nameMkPrimArray;            
extern Name nameMkPrimByteArray;
extern Name nameMkRef;                  
extern Name nameMkPrimMutableArray;     
extern Name nameMkPrimMutableByteArray; 
34 35
extern Name nameMkThreadId;  
extern Name nameMkPrimMVar;  
36 37 38 39 40 41
#ifdef PROVIDE_FOREIGN
extern Name nameMkForeign;   
#endif
#ifdef PROVIDE_WEAK
extern Name nameMkWeak;
#endif
42

43 44 45 46 47 48 49 50 51 52 53

/* For every primitive type provided by the runtime system,
 * we construct a Haskell type using a declaration of the form:
 *
 *   data Int  -- no constructors given
 */
extern Type typeChar;
extern Type typeInt;
extern Type typeInteger;
extern Type typeWord;
extern Type typeAddr;
54 55 56 57 58
extern Type typePrimArray;            
extern Type typePrimByteArray;
extern Type typeRef;                  
extern Type typePrimMutableArray;     
extern Type typePrimMutableByteArray; 
59 60 61
extern Type typeFloat;
extern Type typeDouble;
extern Type typeStable;
62 63
extern Type typeThreadId;
extern Type typeMVar;
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
#ifdef PROVIDE_WEAK
extern Type typeWeak;
#endif
#ifdef PROVIDE_FOREIGN
extern Type typeForeign;
#endif

/* And a smaller number of types defined in plain Haskell */
extern Type typeList;
extern Type typeUnit;
extern Type typeString;
extern Type typeBool;
extern Type typeST;
extern Type typeIO;
extern Type typeException;

/* used while desugaring */
extern Name nameId;
extern Name nameOtherwise;
extern Name nameUndefined;              /* generic undefined value         */

/* used in pattern match */
#if NPLUSK
extern Name namePmSub; 
#endif
extern Name nameSel;

/* used in translation */
extern Name nameEq;     
extern Name namePMFail;
extern Name nameEqChar;
extern Name nameEqInteger;
extern Name namePmInt;
extern Name namePmInteger;
extern Name namePmDouble;
extern Name namePmLe;
extern Name namePmSubtract;
extern Name namePmFromInteger;
extern Name nameMkIO;
extern Name nameUnpackString;
104 105 106 107
extern Name namePrimSeq;
extern Name nameMap;
extern Name nameMinus;

108

109 110 111 112 113 114 115
extern Type  arrow;                     /* mkOffset(0) -> mkOffset(1)      */
extern Type  listof;                    /* [ mkOffset(0) ]                 */
extern Cell  predNum;                   /* Num (mkOffset(0))               */
extern Cell  predFractional;            /* Fractional (mkOffset(0))        */
extern Cell  predIntegral;              /* Integral (mkOffset(0))          */
extern Cell  predMonad;                 /* Monad (mkOffset(0))             */

116 117 118 119 120 121 122 123 124 125 126

extern Type  arrow;                     /* mkOffset(0) -> mkOffset(1)      */
extern       Type  boundPair;;                 /* (mkOffset(0),mkOffset(0))       */
extern       Type  listof;;                    /* [ mkOffset(0) ]                 */
extern       Type  typeVarToVar;;              /* mkOffset(0) -> mkOffset(0)      */

extern       Cell  predNum;;                   /* Num (mkOffset(0))               */
extern       Cell  predFractional;;            /* Fractional (mkOffset(0))        */
extern       Cell  predIntegral;;              /* Integral (mkOffset(0))          */
extern       Kind  starToStar;;                /* Type -> Type                    */
extern       Cell  predMonad;;                 /* Monad (mkOffset(0))             */
127 128