tock-mirror/data
Neil Brown e1c18cc082 Changed inferTypes to resolve operators to the right definition
This patch follows on from the previous change to the parser.  When it spots a function-call, it looks for operators and treats them differently.

It keeps a stack of operators in scope (csOperators in CompState), and when an operator is used, it searches the stack (with all old definitions masked out) for operator definitions to resolve to.

The way it chooses which operator to use in the presence of overloadings (e.g. + on INT vs + on INT32) is simply to try them all.  If one matches, it uses that.  If none, or more than one match, it gives an error.  This makes the code simple and seems logical, but I'm not totally confident if this is the required behaviour for resolving overloaded operators.
2009-04-05 23:01:26 +00:00
..
AST.hs Removed monadic and dyadic operators from the AST 2009-04-05 22:31:26 +00:00
CompState.hs Changed inferTypes to resolve operators to the right definition 2009-04-05 23:01:26 +00:00
Metadata.hs Added a Read instance for Meta (taken from my benchmarks for the ICFP paper) 2009-04-02 15:07:17 +00:00