Hi, Am Dienstag, den 20.03.2018, 13:23 +0000 schrieb Matthew Pickering: > As far as I understand it, the goals of SpecConstr and specialisation > are the same. One works for > normal value arguments and one works for special type class dictionary > arguments. > > However, looking at the pass order in `SimplCore`, specialisation runs > very early before any major simplification but SpecConstr runs very > late right at the end of the pipeline. > > Does anyone know the justification for this? It seems intuitively that > they should work in the same way.
Just a guess: We want the demand analyzer to run before SpecConstr, because I expect that there are many functions where both the demand analyzer are happy to do something, and SpecConstr is happy to do something, but the worker-wrapper done by DmdAnal is strictly preferable (no code duplication, for example.) But the Specializer and the demand analyzer have no overlap, and we we do want to strictness-analyzer the type-class-specialized code. But as I said, it’s just a guess. Cheers, Joachim -- Joachim “nomeata” Breitner [email protected] https://www.joachim-breitner.de/
signature.asc
Description: This is a digitally signed message part
_______________________________________________ ghc-devs mailing list [email protected] http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
