| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 `(# #)`
|
|
|
|
|
|
|
|
|
| |
* allow `integerCompare` to inline into `integerLe#`, etc.
* use `naturalSubThrow` to implement Natural's `(-)`
* use `naturalNegate` to implement Natural's `negate`
* implement and use `integerToNaturalThrow` to implement Natural's `fromInteger`
Thanks to @christiaanb for reporting these
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* GHC.Natural isn't implemented in `base` anymore. It is provided by
ghc-bignum in GHC.Num.Natural. It means that we can safely use Natural
primitives in `base` without fearing issues with built-in rewrite
rules (cf #15286)
* `base` doesn't conditionally depend on an integer-* package anymore,
it depends on ghc-bignum
* Some duplicated code in integer-* can now be factored in GHC.Float
* ghc-bignum tries to use a uniform naming convention so most of the
other changes are renaming
|
|
|
|
|
|
|
|
|
|
| |
* `GHC.Natural` now exports the same functions (regardless of integer backend)
* remove unnecessary CPP around instances
* remove the 'OPTIMISE_INTEGER_GCD_LCM' flag - almost all of those optimizations
now work regardless of which integer backend is used
Note that some CPP still remains for situations where there are backend-specific
optimization hacks (like a more efficient GMP-only `gcd` for `Int#` and `Word#`).
|
|
|
|
| |
GHC Trac Issues: #15447
|
|
|
|
| |
(cherry picked from commit ee545ff44e0ba9a165de40807548c75bf181dda3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This drastically cuts down on the number of Haddock warnings when making
docs for `base`. Plus this means more actual links end up in the docs!
Also fixed other small mostly markup issues in the documentation along
the way.
This is a docs-only change.
Reviewers: hvr, bgamari, thomie
Reviewed By: thomie
Subscribers: thomie, rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5055
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: sjakobi, dfeuer, bgamari, hvr
Reviewed By: sjakobi, bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15078
Differential Revision: https://phabricator.haskell.org/D4736
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for built-in Natural literals in Core.
- Replace MachInt,MachWord, LitInteger, etc. with a single LitNumber
constructor with a LitNumType field
- Support built-in Natural literals
- Add desugar warning for negative literals
- Move Maybe(..) from GHC.Base to GHC.Maybe for module dependency
reasons
This patch introduces only a few rules for Natural literals (compared
to Integer's rules). Factorization of the built-in rules for numeric
literals will be done in another patch as this one is already big to
review.
Test Plan:
validate
test build with integer-simple
Reviewers: hvr, bgamari, goldfire, Bodigrim, simonmar
Reviewed By: bgamari
Subscribers: phadej, simonpj, RyanGlScott, carter, hsyl20, rwbarton,
thomie
GHC Trac Issues: #14170, #14465
Differential Revision: https://phabricator.haskell.org/D4212
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add @since annotations to instances in `base`.
Test Plan:
* ./validate # some commets shouldn't break the build
* review the annotations for absurdities.
Reviewers: ekmett, goldfire, RyanGlScott, austin, hvr, bgamari
Reviewed By: RyanGlScott, hvr, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2277
GHC Trac Issues: #11767
|
|
|
|
|
|
| |
This reverts commit d6e7f5dc9db7e382ce34d649f85505176a451a04.
This commit broke the build on Windows due to CPP weirdness (#9945).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This makes it easier to see what is exported, and allows us to
add non-exported top-level names.
Reviewers: hvr, austin, ezyang
Reviewed By: ezyang
Subscribers: ezyang, carter, thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D551
GHC Trac Issues: #9852
|
| |
|
|
This commit mostly converts literate comments into ordinary
Haskell comments or sometimes even Haddock comments, while also
removing literate comments in a few cases where they don't make
much sense anymore.
Moreover, in a few cases trailing whitespaces were removed as well.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D456
|