Hello again,

On Tue, Mar 1, 2016 at 11:56 AM, Simon Peyton Jones
<[email protected]> wrote:
>
> Don't forget AbsDmd too!
>

Yes, we're working on this too. Currently we're doing something
analogous to what we're doing with StrDmd:

data UseDmd
  = UCall Count UseDmd
  | UProd [ArgUse]
  | USum [(Tag, UseDmd)]
  | UHead
  | Used

The big question deals with how to 'insert' a usage demand on an
alternative of a case into a usage demand on the entire sum. The
current thought is that you collect the usage demands on the fields of
the constructor for the alternative you're analysing (let's say it's
tag 1) and insert that into a USum where the usage demands on all the
other constructors (all the tags except 1) is UHead. The rational
behind using UHead is that the constructor itself is demanded at UHead
by the case expression. Once you have one of these for every
alternative, you lub them together appropriately, so anywhere you
actually used a field would be represented in the final demand on the
sum since UHead `lubUse` u = u


> Do start a wiki page to explain all this.
>

Definitely.

Cheers,

Jose
_______________________________________________
ghc-devs mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to