
On Mon, 13 Oct 2008, Simon Peyton-Jones wrote:
| I wondered whether it is possible to let the compiler read and store the | RULES pragmas without optimizing the code in the same module with respect | to these RULES. When I want to compile the code without optimization - for | whatever reason - I would still like to have the RULES checked. They could | still be applied when imported to another module that is compiled with | optimization.
Indeed you can: use -fno-omit-interface-pragmas. This overrides the default, which is that with -O no non-essential info is put in the interface file.
If you think it's worth improving the documentation (e.g. you didn't know about this), then I'd welcome a concrete suggestion. (eg Say "...this..." in the second bullet off ...".)
I found it just confusing to switch on two features (namely 'optimization including application of rules' and 'parsing, checking and storing new rules') with one option (namely -O). It remains confusing for me also if one of the two features can be enabled separately with -fno-omit-interface-pragmas, but the other feature cannot. Also the option sounds like it also applies not only to RULES. I also find the doubled negation in 'no omit' confusing. What about '-finclude-all-interface-pragmas'? What concerns documentation: The description of an option for enabling parsing of RULES I would expect in ghc-doc/users_guide/rewrite-rules.html.