From b034fbda464c20850831fc6f8b0c706b2afe34bd Mon Sep 17 00:00:00 2001 From: sewardj Date: Wed, 12 Jan 2000 14:52:54 +0000 Subject: [PATCH] [project @ 2000-01-12 14:52:53 by sewardj] Clear up confusion regarding names of tuple types. -- (), coded as Z0T, is the unit. -- (,), coded as Z1T, is the pair type. -- (,,,N commas,,,) coded as ZNT, is the (N+1)-tuple type. -- There is no 1-ary type type. --- ghc/interpreter/link.c | 34 +++++++++++++++++----------------- ghc/interpreter/storage.c | 16 +++++++++------- ghc/interpreter/type.c | 8 +++----- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ghc/interpreter/link.c b/ghc/interpreter/link.c index 1fc2473..5d8e40b 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.36 $ - * $Date: 2000/01/12 10:44:50 $ + * $Revision: 1.37 $ + * $Date: 2000/01/12 14:52:53 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -381,15 +381,15 @@ assert(nonNull(typeInteger)); */ name(namePrimTakeMVar).type = primType(MONAD_Id, "rbc", "d"); - 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); - } + 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); + } } } } @@ -429,10 +429,10 @@ Void linkPreludeCM(void) { /* Hook to cfuns and mfuns in */ nameInRange = linkName("inRange"); nameMinus = linkName("-"); /* These come before calls to implementPrim */ - if (combined) { - for(i=0; i= 100) internal("ghcTupleText_n"); - buf[0] = '('; - for (i = 1; i <= n; i++) buf[i] = ','; - buf[n+1] = ')'; - buf[n+2] = 0; + if (n == 1) internal("ghcTupleText_n==1"); + buf[x++] = '('; + for (i = 1; i <= n-1; i++) buf[x++] = ','; + buf[x++] = ')'; + buf[x++] = 0; return findText(buf); } diff --git a/ghc/interpreter/type.c b/ghc/interpreter/type.c index e2f8277..2446ce0 100644 --- a/ghc/interpreter/type.c +++ b/ghc/interpreter/type.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: type.c,v $ - * $Revision: 1.21 $ - * $Date: 2000/01/07 17:49:29 $ + * $Revision: 1.22 $ + * $Date: 2000/01/12 14:52:54 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -2847,9 +2847,7 @@ Int what; { starToStar = simpleKind(1); - typeUnit = //addPrimTycon(findText("()"), - // STAR,0,DATATYPE,NIL); - findTycon(findText("()")); + typeUnit = findTycon(findText("()")); assert(nonNull(typeUnit)); typeArrow = addPrimTycon(findText("(->)"), -- 1.7.10.4