X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Finterpreter%2Flink.c;h=652c46e5603614a6a78cb4185811efcce63a50cd;hb=f0ee8b7265e07c735539d47ea646ca0cf0634d05;hp=74186f30d0de975fe1ae48ece0bb957f37c145a0;hpb=48fd138cd94a488d519d79dd64281ca6d7a72ff1;p=ghc-hetmet.git diff --git a/ghc/interpreter/link.c b/ghc/interpreter/link.c index 74186f3..652c46e 100644 --- a/ghc/interpreter/link.c +++ b/ghc/interpreter/link.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: link.c,v $ - * $Revision: 1.27 $ - * $Date: 2000/01/07 17:49:29 $ + * $Revision: 1.38 $ + * $Date: 2000/01/12 16:29:47 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -89,7 +89,9 @@ Name nameBind; /* for translating monad comps */ Name nameZero; /* for monads with a zero */ Name nameId; -Name nameRunIO; +Name nameShow; +Name namePutStr; +Name nameRunIO_toplevel; Name namePrint; Name nameOtherwise; @@ -213,9 +215,13 @@ static Name predefinePrim ( String s ); static Tycon linkTycon( String s ) { Tycon tc = findTycon(findText(s)); - if (nonNull(tc)) { - return tc; + if (nonNull(tc)) return tc; + if (combined) { + tc = findTyconInAnyModule(findText(s)); + if (nonNull(tc)) return tc; } +fprintf(stderr, "frambozenvla! unknown tycon %s\n", s ); +return NIL; ERRMSG(0) "Prelude does not define standard type \"%s\"", s EEND; } @@ -223,9 +229,13 @@ static Tycon linkTycon( String s ) static Class linkClass( String s ) { Class cc = findClass(findText(s)); - if (nonNull(cc)) { - return cc; - } + if (nonNull(cc)) return cc; + if (combined) { + cc = findClassInAnyModule(findText(s)); + if (nonNull(cc)) return cc; + } +fprintf(stderr, "frambozenvla! unknown class %s\n", s ); +return NIL; ERRMSG(0) "Prelude does not define standard class \"%s\"", s EEND; } @@ -233,9 +243,13 @@ static Class linkClass( String s ) static Name linkName( String s ) { Name n = findName(findText(s)); - if (nonNull(n)) { - return n; - } + if (nonNull(n)) return n; + if (combined) { + n = findNameInAnyModule(findText(s)); + if (nonNull(n)) return n; + } +fprintf(stderr, "frambozenvla! unknown name %s\n", s ); +return NIL; ERRMSG(0) "Prelude does not define standard name \"%s\"", s EEND; } @@ -366,13 +380,15 @@ Void linkPreludeTC(void) { /* Hook to tycons and classes in */ */ name(namePrimTakeMVar).type = primType(MONAD_Id, "rbc", "d"); - for (i=2; i<=NUM_DTUPLES; i++) {/* Add derived instances of tuples */ - addTupInst(classEq,i); - addTupInst(classOrd,i); - addTupInst(classIx,i); - addTupInst(classShow,i); - addTupInst(classRead,i); - addTupInst(classBounded,i); + if (!combined) { + for (i=2; i<=NUM_DTUPLES; i++) {/* Add derived instances of tuples */ + addTupInst(classEq,i); + addTupInst(classOrd,i); + addTupInst(classIx,i); + addTupInst(classShow,i); + addTupInst(classRead,i); + addTupInst(classBounded,i); + } } } } @@ -412,8 +428,10 @@ Void linkPreludeCM(void) { /* Hook to cfuns and mfuns in */ nameInRange = linkName("inRange"); nameMinus = linkName("-"); /* These come before calls to implementPrim */ - for(i=0; i)"), pair(STAR,pair(STAR,STAR)), 2,DATATYPE,NIL); + + pFun(nameInd, "_indirect"); + name(nameInd).number = DFUNNAME; + } else { modulePrelude = newModule(textPrelude); setCurrModule(modulePrelude); for (i=0; i