From 95b103334db38c77178225be733798cf31ba3c23 Mon Sep 17 00:00:00 2001 From: sewardj Date: Tue, 7 Dec 1999 11:36:40 +0000 Subject: [PATCH] [project @ 1999-12-07 11:36:40 by sewardj] Correctly detect saturated applications of tuples, following recent change to Tuple machinery in Hugs. --- ghc/interpreter/translate.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ghc/interpreter/translate.c b/ghc/interpreter/translate.c index 392472b..135df68 100644 --- a/ghc/interpreter/translate.c +++ b/ghc/interpreter/translate.c @@ -10,8 +10,8 @@ * included in the distribution. * * $RCSfile: translate.c,v $ - * $Revision: 1.22 $ - * $Date: 1999/12/06 16:25:27 $ + * $Revision: 1.23 $ + * $Date: 1999/12/07 11:36:40 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -370,6 +370,7 @@ StgExpr failExpr; List args = NIL; List binds = NIL; List as = NIL; + Int length_args; /* Unwind args */ while (isAp(e)) { @@ -411,12 +412,16 @@ StgExpr failExpr; } /* Special case: saturated constructor application */ - if (isName(e) && isCfun(e) - && name(e).arity > 0 - && name(e).arity == length(args)) { + length_args = length(args); + if ( (isName(e) && isCfun(e) + && name(e).arity > 0 + && name(e).arity == length_args) + || + (isTuple(e) && tycon(e).tuple == length_args) + ) { StgVar v; /* fprintf ( stderr, "saturated application of %s\n", - textToStr(name(e).text)); */ + textToStr(isTuple(e) ? tycon(e).text : name(e).text)); */ v = mkStgVar(mkStgCon(e,args),NIL); binds = cons(v,binds); return mkStgLet(binds,v); -- 1.7.10.4