Comment out CONSTANT_FOLDED in GHC.Natural
ClosedPublic

Authored by christiaanb on Oct 26 2018, 9:51 AM.

Details

Summary

Although these functions were marked as CONSTANT_FOLDED, they did
not have a corresponding builtinRule in PrelRules. The idea was
probably to add them eventually, but this hasn't manifested so
far.

The plan is to eventually add builtin rules for these functions
over Natural, so as a reminder we simply comment out the
CONSTANT_FOLDED annotation instead of removing it completely.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
christiaanb created this revision.Oct 26 2018, 9:51 AM

Fix testsuite output for now inlined negateNatural worker

bgamari accepted this revision.Oct 28 2018, 10:28 AM

Looks good.

I have opened Trac #15821 to track the addition of constant folding rules.

testsuite/tests/numeric/should_compile/T14465.stdout
72

Indeed we really should implement constant folding for Natural. The fact that GHC can't reduce this is pretty embarrassing.

This revision is now accepted and ready to land.Oct 28 2018, 10:28 AM
This revision was automatically updated to reflect the committed changes.