Improve CPR behavior for strict constructors
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 26 Jun 2015 10:40:01 +0000 (11:40 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 26 Jun 2015 16:53:22 +0000 (17:53 +0100)
commit0696fc6d4de28cb589f6c751b8491911a5baf774
treeaf20b546dbd408fba284cadeeded66f089d11fb7
parentcaf9d427d423a8ff63fd4c5a1332d058004751ff
Improve CPR behavior for strict constructors

When working on Trac #10482 I noticed that we could give constructor
arguments the CPR property if they are use strictly.

This is documented carefully in
    Note [CPR in a product case alternative]
and also
    Note [Initial CPR for strict binders]

There are a bunch of intersting examples in
    Note [CPR examples]
which I have added to the test suite as T10482a.

I also added a test for #10482 itself.
compiler/stranal/DmdAnal.hs
testsuite/tests/stranal/T10482a.hs [new file with mode: 0644]
testsuite/tests/stranal/should_compile/Makefile
testsuite/tests/stranal/should_compile/T10482.hs [new file with mode: 0644]
testsuite/tests/stranal/should_compile/T10482.stdout [new file with mode: 0644]
testsuite/tests/stranal/should_compile/T10482a.hs [new file with mode: 0644]
testsuite/tests/stranal/should_compile/T10482a.stdout [new file with mode: 0644]
testsuite/tests/stranal/should_compile/all.T