CPR on sums
Changes PlannedPublic

Authored by osa1 on Aug 1 2016, 7:11 AM.

Details

Summary

NOT READY

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Branch
sum_cpr
Lint
Lint SkippedExcuse: later
Unit
No Unit Test Coverage
Build Status
Buildable 10629
Build 12676: arc lint + arc unit
osa1 updated this revision to Diff 8365.Aug 1 2016, 7:11 AM
osa1 retitled this revision from to CPR on sums.
osa1 updated this object.
osa1 edited the test plan for this revision. (Show Details)
osa1 added a reviewer: simonpj.
bgamari edited edge metadata.Aug 1 2016, 7:34 AM

On my preliminary pass this looked pretty good. However, more comments are almost certainly necessary.

compiler/main/DynFlags.hs
840

Perhaps place doSumCprWw here.

903

Let's try to keep related fields together. Perhaps move it to the point I suggested above?

1618

Here as well.

compiler/stranal/WwLib.hs
117

A bit more description in the comment would be helpful: -> -- ^ the name of the function being worker/wrappered for debugging.

osa1 planned changes to this revision.Aug 1 2016, 7:56 AM
simonpj added inline comments.Aug 12 2016, 8:28 AM
compiler/stranal/WwLib.hs
660

All that is going on here is to generate a wrapper like this

case _ of
   (# (# a,b #) | #) -> C1 a b
   (# | d #)         -> C2 d

and for the worker

case _ of 
  C1 a b -> (# (# a,b #) | #)
  C2 d   -> (# | d #)

Write a proper example in a Note, including the coercion part

675

use mapM