public static final Name Prelude_bind = Name.create("Prelude", ">>=");
public static final Name Prelude_build = Name.create("Prelude", "build");
public static final Name Prelude_concatMap = Name.create("Prelude", "concatMap");
+ public static final Name Prelude_dollar = Name.create("Prelude", "$");
public static final Name Prelude_elem = Name.create("Prelude", "elem");
public static final Name Prelude_elemMaybe = Name.create("Prelude", "elemMaybe");
public static final Name Prelude_emptyList = Name.create("Prelude", "emptyList");
public static final Name Prelude_foldl = Name.create("Prelude", "foldl");
- public static final Name Prelude_fromDouble = Name.create("Prelude", "fromDouble");
- public static final Name Prelude_fromInteger = Name.create("Prelude", "fromInteger");
+ public static final Name Prelude_fromDouble = Name.create("Prelude", "fromDouble");
+ public static final Name Prelude_fromInteger = Name.create("Prelude", "fromInteger");
public static final Name Prelude_guardList = Name.create("Prelude", "guardList");
public static final Name Prelude_iterList = Name.create("Prelude", "iterList");
public static final Name Prelude_mapFirst = Name.create("Prelude", "mapFirst");
import java.util.ArrayList;
import org.simantics.scl.compiler.common.names.Name;
+import org.simantics.scl.compiler.common.names.Names;
import org.simantics.scl.compiler.constants.NoRepConstant;
import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
@Override
public Expression inferType(TypingContext context) {
+ if(parameters.length == 2 && function instanceof EConstant && ((EConstant)function).value.getName() == Names.Prelude_dollar)
+ return new EApply(location, parameters[0], parameters[1]).inferType(context);
inferType(context, false);
return this;
}
@Override
public Expression checkIgnoredType(TypingContext context) {
+ if(parameters.length == 2 && function instanceof EConstant && ((EConstant)function).value.getName() == Names.Prelude_dollar)
+ return new EApply(location, parameters[0], parameters[1]).inferType(context);
inferType(context, true);
if(Types.canonical(getType()) != Types.UNIT)
return new ESimpleLet(location, null, this, new ELiteral(NoRepConstant.PUNIT));