1. 21 Nov, 2014 2 commits
  2. 20 Nov, 2014 3 commits
  3. 19 Nov, 2014 5 commits
    • Luite Stegeman's avatar
      add missing instances for Loc and a few missing Eq instances · b0477338
      Luite Stegeman authored
      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
    • Mathieu Boespflug's avatar
      template-haskell: Missing instances for Rational and (). · b3df5f6b
      Mathieu Boespflug authored
      Test Plan: ./validate
      Reviewers: austin
      Reviewed By: austin
      Subscribers: thomie, carter
      Differential Revision: https://phabricator.haskell.org/D492
    • thomie's avatar
      Refactor: use System.FilePath.splitSearchPath · 6fc78fdf
      thomie authored
      To address #2521 ("Trailing colon on GHC_PACKAGE_PATH doesn't work with
      ghc-pkg"), we were using a custom version of splitSearchPath (e4f46f5d). 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
    • Herbert Valerio Riedel's avatar
      Optimise `Identity` instances with `coerce` · 4ba884bd
      Herbert Valerio Riedel authored
      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
    • Herbert Valerio Riedel's avatar
      Reimplement im/export primitives for integer-gmp2 · 42244668
      Herbert Valerio Riedel authored
      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
  4. 18 Nov, 2014 7 commits
  5. 15 Nov, 2014 3 commits
    • Herbert Valerio Riedel's avatar
      Fix compilation of `integer-gmp2` with `-O0` · c45e2e29
      Herbert Valerio Riedel authored
      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.
    • Herbert Valerio Riedel's avatar
      Update to (unreleased) `deepseq-` · 609cd28a
      Herbert Valerio Riedel authored
      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
    • Edward Z. Yang's avatar
      Generalize exposed-modules field in installed package database · e14a9732
      Edward Z. Yang authored
      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: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      Test Plan: validate
      Reviewers: simonpj, duncan, austin
      Subscribers: thomie, carter, simonmar
      Differential Revision: https://phabricator.haskell.org/D421
  6. 13 Nov, 2014 7 commits
    • David Feuer's avatar
      Implement amap/coerce for Array (re #9796) · 603b7be7
      David Feuer authored
      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
    • Herbert Valerio Riedel's avatar
      Fix `integer-gmp2` compilation with GMP 4.x (#9281) · 63a9d938
      Herbert Valerio Riedel authored
      GMP 4.x didn't provide the `mp_bitcnt_t` typedef yet, so we locally
      define one if GMP 4.x is detected.
    • David Feuer's avatar
      Improve `Foldable` instance for `Array` · 212a3505
      David Feuer authored
      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
      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
    • David Feuer's avatar
      base: define `sequence = mapM id` · c016e6f7
      David Feuer authored
      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
    • David Feuer's avatar
      Make unwords and words fuse somewhat · e73ab541
      David Feuer authored
      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
    • David Feuer's avatar
      base: Fix map/coerce comment · 413c747a
      David Feuer authored
      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
    • David Terei's avatar
      Add `--fwarn-trustworthy-safe` to `-Wall` · 475dd93e
      David Terei authored
      Update submodule haskell2010, haskell98, hoop, hpc and stm to fix new
  7. 12 Nov, 2014 7 commits
    • eir@cis.upenn.edu's avatar
    • eir@cis.upenn.edu's avatar
    • eir@cis.upenn.edu's avatar
      Derive Generic for TH types (#9527) · 88a42be1
      eir@cis.upenn.edu authored
    • eir@cis.upenn.edu's avatar
    • eir@cis.upenn.edu's avatar
      Untabify template-haskell. · f61b3c41
      eir@cis.upenn.edu authored
    • Simon Marlow's avatar
      Per-thread allocation counters and limits · d70b19bf
      Simon Marlow authored
      This reverts commit f0fcc41d.
      New changes: now works on 32-bit platforms too.  I added some basic
      support for 64-bit subtraction and comparison operations to the x86
    • Herbert Valerio Riedel's avatar
      Implement new integer-gmp2 from scratch (re #9281) · c774b28f
      Herbert Valerio Riedel authored
      This is done as a separate `integer-gmp2` backend library because it
      turned out to become a complete rewrite from scratch.
      Due to the different (over)allocation scheme and potentially different
      accounting (via the new `{shrink,resize}MutableByteArray#` primitives),
      some of the nofib benchmarks actually results in increased allocation
      numbers (but not necessarily an increase in runtime!).  I believe the
      allocation numbers could improve if `{resize,shrink}MutableByteArray#`
      could be optimised to reallocate in-place more efficiently.
      Here are the more apparent changes in the latest nofib comparision
      between `integer-gmp` and `integer-gmp2`:
                Program     Size    Allocs   Runtime   Elapsed  TotalMem
             bernouilli    +1.6%    +15.3%     0.132     0.132      0.0%
           cryptarithm1    -2.2%      0.0%     -9.7%     -9.7%      0.0%
                  fasta    -0.7%     -0.0%    +10.9%    +10.9%      0.0%
                  kahan    +0.6%    +38.9%     0.169     0.169      0.0%
                   lcss    -0.7%     -0.0%     -6.4%     -6.4%      0.0%
                 mandel    +1.6%    +33.6%     0.049     0.049      0.0%
               pidigits    +0.8%     +8.5%     +3.9%     +3.9%      0.0%
                  power    +1.4%    -23.8%    -18.6%    -18.6%    -16.7%
              primetest    +1.3%    +50.1%     0.085     0.085      0.0%
                    rsa    +1.6%    +53.4%     0.026     0.026      0.0%
                    scs    +1.2%     +6.6%     +6.5%     +6.6%    +14.3%
                 symalg    +1.0%     +9.5%     0.010     0.010      0.0%
              transform    -0.6%     -0.0%     -5.9%     -5.9%      0.0%
                    Min    -2.3%    -23.8%    -18.6%    -18.6%    -16.7%
                    Max    +1.6%    +53.4%    +10.9%    +10.9%    +14.3%
         Geometric Mean    -0.3%     +1.9%     -0.8%     -0.8%     +0.0%
      (see P35 / https://phabricator.haskell.org/P35 for full report)
      By default, `INTEGER_LIBRARY=integer-gmp2` is active now, which results
      in the package `integer-gmp-` being registered in the package db.
      The previous `integer-gmp-` can be restored by setting
      `INTEGER_LIBRARY=integer-gmp` (but will probably be removed altogether
      for GHC 7.12). In-tree GMP support has been stolen from the old
      `integer-gmp` (while unpatching the custom memory-allocators, as well as
      forcing `-fPIC`)
      A minor hack to `ghc-cabal` was necessary in order to support two different
      `integer-gmp` packages (in different folders) with the same package key.
      There will be a couple of follow-up commits re-implementing some features
      that were dropped to keep D82 minimal, as well as further
      More information can be found via #9281 and
      Reviewed By: austin, rwbarton, simonmar
      Differential Revision: https://phabricator.haskell.org/D82
  8. 11 Nov, 2014 2 commits
    • David Feuer's avatar
      De-bias Data.Foldable and improve docstrings · e5671302
      David Feuer authored
      Use fewer left/right-biased folds for defaults and
      functions in `Data.Foldable`, to better support things
      that don't look like cons lists.
      This also extends the Haddock docstrings in `Data.Foldable`.
      Reviewed By: hvr, ekmett
      Differential Revision: https://phabricator.haskell.org/D441
    • David Feuer's avatar
      Define list monad operations using comprehensions · 4923cea5
      David Feuer authored
      Define list monad operations using list comprehensions. Code using monad
      operations with lists did not fuse fully. Writing list code with `do`
      notation or `(>>=)` and `(>>)` operations could allocate more than
      equivalent code using list comprehensions.
      Define `mapM` directly, instead of using `sequence` and `map`. This
      leads to substantially less allocation in `cryptarithm2`.
      Addresses #9781
      Reviewed By: ekmett, nomeata
      Differential Revision: https://phabricator.haskell.org/D455
  9. 10 Nov, 2014 1 commit
  10. 08 Nov, 2014 2 commits
  11. 07 Nov, 2014 1 commit