| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The following wiki page contains more information about this:
https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/GenericDeriving#Amoreconservativefirstapproachtothisproblem
|
|
|
|
|
| |
This calls the `popCountBigNat` primitive directly instead of going
through `Integer`'s `popCount`.
|
|
|
|
|
|
| |
This provides the equivalent of the existing `{gcd,lcm}/Integer`
optimisations for the `Natural` type, when using the `integer-gmp2`
backend.
|
|
|
|
|
|
| |
This fixes a case where `isValidNatural . fromInteger` would be `False`.
Re #9818
|
|
|
|
|
|
|
|
|
| |
This predicate function encodes the internal `Natural` invariants, and
is useful for testsuites or code that directly constructs `Natural`
values.
C.f. `integer-gmp2`'s `isValidBigNat#` and `isValidInteger#` predicates
for testing internal invariants.
|
|
|
|
|
|
| |
This makes use of the `gcdWord` primitive provided by
be7fb7e58c70cd9b0a933fb26cd5f2607d6dc4b2 which should make the
`Word`-variant of `gcd` as performant as the `Int`-variant.
|
|
|
|
|
| |
This is slipped in by accident as part of
c774b28f76ee4c220f7c1c9fd81585e0e3af0e8a (re #9281)
|
|
|
|
|
|
| |
It's trivial for `integer-gmp2` (#9281) to provide it, and it'll be
useful for a future 'Natural'-related commit, as well as providing a
`Word` optimised `gcd`-RULE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements a `Natural` type for representing unsigned arbitrary
precision integers.
When available, `integer-gmp>=1.0.0`'s `BigNat` type is used as
building-block to construct `Natural` as an algebraic data-type.
Otherwise, `Natural` falls back being a `newtype`-wrapper around
`Integer` (as is done in Edward Kmett's `nats` package).
The `GHC.Natural` module exposes an internal GHC-specific API, while
`Numeric.Natural` provides the official & portable API.
Reviewed By: austin, ekmett
Differential Revision: https://phabricator.haskell.org/D473
|
|
|
|
|
|
|
|
|
|
|
|
| |
The library submission was accepted:
http://www.haskell.org/pipermail/libraries/2014-September/023777.html
The T5892ab testcases were changed to use `Data.Tree` instead of `Data.Version`
Reviewed By: ekmett
Differential Revision: https://phabricator.haskell.org/D395
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new function `Data.Bits.toIntegralSized` provides a similar
functionality to `fromIntegral` but adds validation that the
argument fits in the result type's size.
The implementation of `toIntegralSized` has been derived from `intCastMaybe`
(which is part of Herbert Valerio Riedel's `int-cast` package,
see http://hackage.haskell.org/package/int-cast)
Addresses #9816
Reviewed By: ekmett, austin
Differential Revision: https://phabricator.haskell.org/D512
|
|
|
|
|
|
|
|
| |
Defaults to using `show` to prevent any breakage of existing code. Also
provide a custom implementation for `SomeException` which uses the
underlying exception's `displayException`.
Differential Revision: https://phabricator.haskell.org/D517
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
fillBytes uses 'memset' to fill a memory area with a given byte value.
Reviewed By: austin, hvr
Differential Revision: https://phabricator.haskell.org/D465
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the module `Data.Void` (formerly provided by Edward Kmett's `void`
package) to `base`.
The original Haskell98 compatible implementation has been modified to use
modern GHC features (among others this makes use of `EmptyCase` as
motivated by #2431), and `vacuousM` was dropped since it's redundant now
with the AMP in place. Instances for classes not part of `base` had to be
dropped as well.
TODO: Documentation could be improved
Reviewed By: ekmett, austin
Differential Revision: https://phabricator.haskell.org/D506
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes #9368
Reviewers: nomeata, hvr, ekmett, austin
Reviewed By: ekmett, austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D498
GHC Trac Issues: #9368
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The `Data.OldList` module was originally created in
3daf0023d2dcf7caf85d61f2dc177f8e9421b2fd to provide a way to access the
original list-specialised functions from `Data.List`. It was also made
an exposed module in order to facilitate adapting the
`haskell2010`/`haskell98` packages. However, since the
`haskell2010`/`haskell98` packages were dropped, we no longer need to
expose `Data.OldList`.
Depends on D511
Reviewers: ekmett, austin
Reviewed By: ekmett, austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D513
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Depends on D510. This is the final blow and removes them from
the tree completely.
Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: I looked really hard but didn't see them.
Reviewers: hvr, ekmett
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D511
GHC Trac Issues: #9590
|
|
|
|
|
| |
This includes a submodule update for `array`.
There is also an added test in libraries/array/tests/T9220.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Alas `{-# LANGUAGE Safe #-}` can't be used since `Data.Coerce` isn't "safe".
However, we use `coerce` just as an optimisation
(see also 4ba884bdd3a9521ea92fcda8f601a7d0f3537bc1 which broke the
safe-inferred status of `Data.Functor.Identity`), so this module at least
deserves `{-# LANGUAGE Trustworthy #-}`.
NOTE: `Data.Functor.Identity` was added to `base` in the context of #9664
Reviewed By: luite
Differential Revision: https://phabricator.haskell.org/D507
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in ghc ForeignCall.hs
this impliments #9703 from ghc trac
Test Plan: still needs tests
Reviewers: cmsaperstein, ekmett, goldfire, austin
Reviewed By: goldfire, austin
Subscribers: goldfire, thomie, carter, simonmar
Differential Revision: https://phabricator.haskell.org/D353
GHC Trac Issues: #9703
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This adds a few missing instances that can be automatically derived
Reviewers: hvr, goldfire, austin
Reviewed By: goldfire, austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D495
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: ./validate
Reviewers: austin
Reviewed By: austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D492
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
To address #2521 ("Trailing colon on GHC_PACKAGE_PATH doesn't work with
ghc-pkg"), we were using a custom version of splitSearchPath (e4f46f5de). This
solution however caused issue #9698 ("GHC_PACKAGE_PATH should be more lenient
for empty paths").
This patch reverts back to System.FilePath.splitSearchPath (fixes #9698) and
adresses (#2521) by testing for a trailing search path separators explicitly
(instead of implicitly using empty search path elements).
Empty paths are now allowed (ignored on Windows, interpreted as current
directory on Posix systems), and trailing path separator still tack on the
user and system package databases.
Also update submodule filepath, which has a version of splitSearchPath which
handles quotes in the same way as our custom version did.
Test Plan:
$ GHC_PACKAGE_PATH=/::/home: ./ghc-pkg list
...
db stack: ["/",".","/home","<userdb>","<systemdb>"]
...
Reviewers: austin
Reviewed By: austin
Subscribers: thomie, carter, simonmar
Differential Revision: https://phabricator.haskell.org/D414
GHC Trac Issues: #2521, #9698
|
|
|
|
|
|
|
|
|
|
|
|
| |
This also overrides all optional `Foldable` methods
(which would otherwise be default-implemented in terms of `foldMap`)
with supposedly optimally minimal implementations.
While at it, this also removes the redundant `{-# LANGUAGE CPP #-}`.
Reviewed By: austin, dfeuer
Differential Revision: https://phabricator.haskell.org/D467
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The import/export operations were available in `integer-gmp-0.5.1`
already, but need to be reimplemented from scratch for the
`integer-gmp-1.0.0` rewrite.
This also adds a few more operations than were previously available for
use w/ the `BigNat` type (which will be useful for implementing
serialisation for the upcoming `Natural` type)
Specifically, the following operations are (re)added (albeit with
slightly different type-signatures):
- `sizeInBaseBigNat`
- `sizeInBaseInteger`
- `sizeInBaseWord#`
- `exportBigNatToAddr`
- `exportIntegerToAddr`
- `exportWordToAddr`
- `exportBigNatToMutableByteArray`
- `exportIntegerToMutableByteArray`
- `exportWordToMutableByteArray`
- `importBigNatFromAddr`
- `importIntegerFromAddr`
- `importBigNatFromByteArray`
- `importIntegerFromByteArray`
NOTE: The `integerGmpInternals` test-case is updated but not yet
re-enabled as it contains tests for other primitives which aren't
yet reimplemented.
This addresses #9281
Reviewed By: austin, duncan
Differential Revision: https://phabricator.haskell.org/D480
|
|
|
|
|
|
| |
This broke validate due to name shadowing warnings.
This reverts commit 1f6b1ab4b6d7203481bfaf374b014972f7756fb2.
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
| |
Reviewed-by: Edward Kmett <ekmett@gmail.com>
Authored-by: Yalas, Scott Turner
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Instead, describe what it actually does.
Reviewers: austin, ekmett, simonpj, hvr
Reviewed By: austin, ekmett
Subscribers: simonpj, thomie, carter
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D448
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Make listArray fuse with a list producer. Note: if code size increases too much, we can fix that with some `RULES`.
Reviewers: nomeata, hvr, austin, ekmett, simonmar, bgamari
Reviewed By: bgamari
Subscribers: bgamari, thomie, carter
Differential Revision: https://phabricator.haskell.org/D474
GHC Trac Issues: #9801
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
It describes a work around Trac #3838, but it is already fixed and the
workaround removed, Trac #7653
Test Plan: not needed
Reviewers: hvr, Mikolaj, austin
Reviewed By: austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D478
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin
Reviewed By: austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D481
GHC Trac Issues: #4900
|
|
|
|
|
|
|
|
|
|
|
|
| |
At optimization level `-O0` `wordToInteger` wasn't inlined, and this caused a
`__integer` literal to turn up in final Core, which would trigger the GHC panic
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 7.9.20141114 for x86_64-unknown-linux):
Can't use Integer in integer-*
By forcing inlining via `inline` this is avoided.
This should hopefully address #9800.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This pulls in the new `Generic`-based `-XDefaultSignature`-based default
implementation for `rnf`[1], and will be interesting to use in combination
with the soon to be merged `-XDeriveAnyClass` extension.
This requires updating several other submodules as well in order
to relax the upper bound on `deepseq` and/or in a few cases to
avoid relying on the default method implementation of `rnf`:
- `Cabal`
- `bytestring`
- `containers`
- `parallel`
- `process`
- `time`
[1]: http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/23031
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Instead of recording exposed-modules and reexported-modules as seperate
fields in the installed package database, this commit merges them into
a single field (exposed-modules). The motivation for this change is
in preparation for the inclusion of *signatures* into the installed
package database, which may also be reexported. Merging the representation
means that we can treat reexports uniformly, no matter if they're a normal
module or a signature.
This commit adds a stub for signatures, but that code isn't wired up to
anything yet.
Contains Cabal submodule update to accommodate these changes.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, duncan, austin
Subscribers: thomie, carter, simonmar
Differential Revision: https://phabricator.haskell.org/D421
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement an `amap`/`coerce` rule in `GHC.Arr` to match the
`map`/`coerce` rule in GHC.Base.
In order to do so, delay inlining `amap` until phase 1.
To prevent the inlining delay from causing major inefficiencies due to
missed list fusion, rewrite `amap` to avoid relying on list fusion. This
has the extra benefit of reducing the size of the compiled amap code by
skipping the impossible case of an array with a negative size.
Reviewed By: nomeata
Differential Revision: https://phabricator.haskell.org/D471
|
|
|
|
|
| |
GMP 4.x didn't provide the `mp_bitcnt_t` typedef yet, so we locally
define one if GMP 4.x is detected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, `Array`s were simply converted to lists, and the list
methods used. That works acceptably well for `foldr` and `foldr1`, but
not so sensibly for most other things. Left folds ended up "twisted" the
way they are for lists, leading to surprising performance
characteristics.
Moreover, this implements `length` and `null` so they check the array
size directly.
Finally, a test is added to the testsuite ensuring the overridden
`Foldable` methods agree with their expected default semantics.
Addresses #9763
Reviewed By: hvr, austin
Differential Revision: https://phabricator.haskell.org/D459
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids duplication in `GHC.Base`; originally, we had
mapM f = sequence . map f
This led to excessive allocation in `cryptarithm2`. Defining
sequence = mapM id
does not appear to cause any `nofib` problems.
Reviewed By: hvr
Differential Revision: https://phabricator.haskell.org/D470
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make `words` a good producer and `unwords` a good consumer for list
fusion. Thus `unwords . words` will avoid producing an intermediate list
of words, although it will produce each individual word.
Make `unwords` slightly lazier, so that
`unwords (s : undefined) = s ++ undefined` instead of `= undefined`.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D375
|
|
|
|
|
|
|
|
|
| |
Make the comment on the map/coerce rule refer to the right section in
the paper; give the full name of the papers, and name its authors.
[skip ci]
Differential Revision: https://phabricator.haskell.org/D472
|
|
|
|
|
| |
Update submodule haskell2010, haskell98, hoop, hpc and stm to fix new
warnings.
|
| |
|
| |
|
| |
|
| |
|