These changes allow the compiler to accept the contravariance_poly.m test case that requires higher order pred insts to be contravariant in the initial argument insts. Previously the compiler would have rejected it, if not for the hack that allows ground to match incomplete bound insts. compiler/inst_match.m: pred_inst_argmodes_matches enabled the cs_reverse mode when matching initial insts, which causes handle_inst_var_subs to swap the insts for the inst var substitution calculation. The insts are swapped back for inst matching, but cs_reverse remained effective. A recursive call to match two insts would swap the insts *again*, to the wrong order. The fix is to invert cs_reverse to cs_forward when the insts are swapped back for matching. In pred_inst_argmodes_matches apply the incrementally calculated inst var substitution before matching. compiler/modecheck_util.m: Make handle_implied_mode use inst_matches_initial_no_implied_modes_sub. The non-sub variant does not compute inst var substitutions and fails where the higher-order argument inst has an inst variable (as in contravariance_poly.m), then handle_implied_mode incorrectly deduces that the call is to an implied mode.
Mercury
Mercury is a logic/functional programming language which combines the clarity and the expressiveness of declarative programming with advanced static analysis and error detection features.
More information is available on the website's about pages, in other README files in the source code repository, and in the documentation.
README files
The Mercury compiler has a number of different backends and works on different operating systems. Specific information is contained in individual README files:
-
Bootstrapping discusses how to get Mercury installed.
This is important as the Mercury compiler is written in Mercury.
-
C Low-level backend
This backend works well with GCC but also works with:
-
High-level backend targets
-
Platforms
-
Cross compilation
Other information
See the current release notes for the latest stable release. The history file is relevant if you want to find out more about the past development of Mercury. News lists any current or future enhancements (but this isn't always up-to-date). The limitations file lists a number of ways in which the Mercury implementation does not yet meet its goals.
Information for developers
If you are considering contributing to the Mercury project the website contains that may be helpful. These include a document about contributions in general and specific information about contributing such as coding styles.
Contact
See our contact page.