* included in the distribution.
*
* $RCSfile: translate.c,v $
- * $Revision: 1.31 $
- * $Date: 2000/04/05 10:25:09 $
+ * $Revision: 1.33 $
+ * $Date: 2000/04/06 15:05:30 $
* ------------------------------------------------------------------------*/
#include "hugsbasictypes.h"
if ( (isName(e) && isCfun(e)
&& name(e).arity > 0
&& name(e).arity == length_args
- && !name(e).hasStrict)
+ && !name(e).hasStrict
+ && numQualifiers(name(e).type) == 0)
||
(isTuple(e) && tycon(e).tuple == length_args)
) {
Void implementCfun(c,scs) /* Build implementation for constr */
Name c; /* fun c. scs lists integers (1..)*/
List scs; { /* in incr order of strict fields. */
- Int a = name(c).arity;
+ Int a = name(c).arity; /* arity, not incl dictionaries */
+ Int ad = numQualifiers(name(c).type); /* the number of dictionaries */
+ Type t = name(c).type;
- if (a > 0) {
+ /* a+ad is total arity for this fn */
+ if (a+ad > 0) {
StgVar vcurr, e1, v, vsi;
List args = makeArgs(a);
+ List argsd = makeArgs(ad);
StgVar v0 = mkStgVar(mkStgCon(c,args),NIL);
List binds = singleton(v0);
}
binds = rev(binds);
e1 = mkStgLet(binds,vcurr);
- v = mkStgVar(mkStgLambda(args,e1),NIL);
+ v = mkStgVar(mkStgLambda(dupOnto(argsd,args),e1),NIL);
name(c).stgVar = v;
} else {
StgVar v = mkStgVar(mkStgCon(c,NIL),NIL);