summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/integer/naturalConstantFolding.hs
Commit message (Collapse)AuthorAgeFilesLines
* Bignum: add Natural constant folding rules (#15821)Sylvain Henry2021-01-231-0/+172
* Implement constant folding rules for Natural (similar to Integer ones) * Add mkCoreUbxSum helper in GHC.Core.Make * Remove naturalTo/FromInt We now only provide `naturalTo/FromWord` as the semantics is clear (truncate/zero-extend). For Int we have to deal with negative numbers (throw an exception? convert to Word beforehand?) so we leave the decision about what to do to the caller. Moreover, now that we have sized types (Int8#, Int16#, ..., Word8#, etc.) there is no reason to bless `Int#` more than `Int8#` or `Word8#` (for example). * Replaced a few `()` with `(# #)`