Commit 0d2aee5f authored by sewardj's avatar sewardj
Browse files

[project @ 2000-03-10 19:50:44 by sewardj]

Major cleanup of header files.  Merge the 5 deleted files into connect.h.
Organise connect.h to gather declarations into roughtly related
categories.
parent 37fe8f8c
/* --------------------------------------------------------------------------
* Interpreter command structure
*
* The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the
* Yale Haskell Group, and the Oregon Graduate Institute of Science and
* Technology, 1994-1999, All rights reserved. It is distributed as
* free software under the license in the file "License", which is
* included in the distribution.
*
* $RCSfile: command.h,v $
* $Revision: 1.6 $
* $Date: 1999/10/15 22:35:05 $
* ------------------------------------------------------------------------*/
typedef Int Command;
struct cmd {
String cmdString;
Command cmdCode;
};
extern Command readCommand Args((struct cmd *, Char, Char));
#define EDIT 0
#define FIND 1
#define LOAD 2
#define ALSO 3
#define PROJECT 4
#define RELOAD 5
#define EVAL 6
#define TYPEOF 7
#define HELP 8
#define NAMES 9
#define BADCMD 10
#define SET 11
#define QUIT 12
#define SYSTEM 13
#define CHGDIR 14
#define INFO 15
#define COLLECT 16
#define SETMODULE 17
#define DUMP 18
#define STATS 19
#define BROWSE 20
#define XPLAIN 21
#define PNTVER 22
#define NOCMD 23
/*-------------------------------------------------------------------------*/
This diff is collapsed.
extern void* getDLLSymbol Args((Int,String,String));
extern Bool stdcallAllowed Args((void));
extern Cell conCons;
extern Name nameShow;
extern Name namePutStr;
extern Name nameRunIO_toplevel;
/* 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;
extern Name nameMkThreadId;
extern Name nameMkPrimMVar;
#ifdef PROVIDE_FOREIGN
extern Name nameMkForeign;
#endif
#ifdef PROVIDE_WEAK
extern Name nameMkWeak;
#endif
/* 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;
extern Type typePrimArray;
extern Type typePrimByteArray;
extern Type typeRef;
extern Type typePrimMutableArray;
extern Type typePrimMutableByteArray;
extern Type typeFloat;
extern Type typeDouble;
extern Type typeStable;
extern Type typeThreadId;
extern Type typeMVar;
#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;
extern Name namePrimSeq;
extern Name nameMap;
extern Name nameMinus;
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)) */
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)) */
/* --------------------------------------------------------------------------
* Definitions for substitution data structure and operations.
*
* The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the
* Yale Haskell Group, and the Oregon Graduate Institute of Science and
* Technology, 1994-1999, All rights reserved. It is distributed as
* free software under the license in the file "License", which is
* included in the distribution.
*
* $RCSfile: subst.h,v $
* $Revision: 1.7 $
* $Date: 2000/03/10 14:53:00 $
* ------------------------------------------------------------------------*/
typedef struct { /* Each type variable contains: */
Type bound; /* A type skeleton (unbound==NIL) */
Int offs; /* Offset for skeleton */
Kind kind; /* kind annotation */
} Tyvar;
#if FIXED_SUBST /* storage for type variables */
extern Tyvar tyvars[];
#else
extern Tyvar *tyvars; /* storage for type variables */
#endif
extern Int typeOff; /* offset of result type */
extern Type typeIs; /* skeleton of result type */
extern Int typeFree; /* freedom in instantiated type */
extern List predsAre; /* list of predicates in type */
extern List genericVars; /* list of generic vars */
extern List btyvars; /* explicitly scoped type vars */
#define tyvar(n) (tyvars+(n)) /* nth type variable */
#define tyvNum(t) ((t)-tyvars) /* and the corresp. inverse funct. */
#define isBound(t) (((t)->bound) && ((t)->bound!=SKOLEM))
#define aVar mkOffset(0) /* Simple skeletons for type vars */
#define bVar mkOffset(1)
#define enterBtyvs() btyvars = cons(NIL,btyvars)
#define leaveBtyvs() btyvars = tl(btyvars)
#define deRef(tyv,t,o) while ((tyv=getTypeVar(t,o)) && isBound(tyv)) { \
t = tyv->bound; \
o = tyv->offs; \
}
/* offs values when isNull(bound): */
#define FIXED_TYVAR 0 /* fixed in current assumption */
#define UNUSED_GENERIC 1 /* not fixed, not yet encountered */
#define GENERIC 2 /* GENERIC+n==nth generic var found*/
extern char *unifyFails; /* Unification error message */
extern Void emptySubstitution Args((Void));
extern Int newTyvars Args((Int));
#define newKindvars(n) newTyvars(n)
extern Int newKindedVars Args((Kind));
extern Void instantiate Args((Type));
extern Pair findBtyvs Args((Text));
extern Void markBtyvs Args((Void));
extern Type localizeBtyvs Args((Type));
extern Tyvar *getTypeVar Args((Type,Int));
extern Void tyvarType Args((Int));
extern Void bindTv Args((Int,Type,Int));
extern Cell getDerefHead Args((Type,Int));
extern Void expandSyn Args((Tycon, Int, Type *, Int *));
extern Void clearMarks Args((Void));
extern Void markAllVars Args((Void));
extern Void resetGenerics Args((Void));
extern Void markTyvar Args((Int));
extern Void markType Args((Type,Int));
extern Void markPred Args((Cell));
extern Type copyTyvar Args((Int));
extern Type copyType Args((Type,Int));
extern Cell copyPred Args((Cell,Int));
extern Type dropRank2 Args((Type,Int,Int));
extern Type dropRank1 Args((Type,Int,Int));
extern Void liftRank2Args Args((List,Int,Int));
extern Type liftRank2 Args((Type,Int,Int));
extern Type liftRank1 Args((Type,Int,Int));
#ifdef DEBUG_TYPES
extern Type debugTyvar Args((Int));
extern Type debugType Args((Type,Int));
#endif
extern Kind copyKindvar Args((Int));
extern Kind copyKind Args((Kind,Int));
extern Bool eqKind Args((Kind,Kind));
extern Kind getKind Args((Cell,Int));
extern List genvarTyvar Args((Int,List));
extern List genvarType Args((Type,Int,List));
extern Bool doesntOccurIn Args((Tyvar*,Type,Int));
extern Bool unify Args((Type,Int,Type,Int));
extern Bool kunify Args((Kind,Int,Kind,Int));
extern Void typeTuple Args((Cell));
extern Void varKind Args((Int));
extern Bool samePred Args((Cell,Int,Cell,Int));
extern Bool matchPred Args((Cell,Int,Cell,Int));
extern Bool unifyPred Args((Cell,Int,Cell,Int));
extern Inst findInstFor Args((Cell,Int));
extern Void improve Args((Int,List,List));
extern Void improve1 Args((Int,List,Cell,Int));
extern Bool sameSchemes Args((Type,Type));
extern Bool sameType Args((Type,Int,Type,Int));
extern Bool matchType Args((Type,Int,Type,Int));
/*-------------------------------------------------------------------------*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment