 13 May, 2018 6 commits


Sylvain Henry authored
Refactor LitString so that the string length is computed at most once and then stored. Also remove strlen and memcmp wrappers (it seems like they were a workaround for a very old GCC when using fviaC). Bumps haddock submodule. Reviewers: bgamari, dfeuer, nickkuk Reviewed By: bgamari, nickkuk Subscribers: nickkuk, dfeuer, thomie, carter Differential Revision: https://phabricator.haskell.org/D4630

Ben Gamari authored

Ben Gamari authored
Summary: This fixes #15067. Test Plan: Validate Subscribers: thomie, carter, RyanGlScott GHC Trac Issues: #15067 Differential Revision: https://phabricator.haskell.org/D4623

Ben Gamari authored
Previously `showEFloat (Just 0) pi ""` would produce `3.0e0`. Of course, this blatantly disrespects the user's request to print with zero digits of precision. Fix this. This is tested by base's `num008` testcase. Test Plan: Validate Reviewers: hvr Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15115 Differential Revision: https://phabricator.haskell.org/D4665

Matthew Pickering authored
This patch takes the much simpler route of whenever the compiler tries to output something. We just dump a JSON document there and then. I think this should be sufficient to work with and anything more refined quickly got complicated as it was necessary to demarcate message scopes and so on. Reviewers: bgamari, dfeuer Reviewed By: bgamari Subscribers: Phyx, dfeuer, rwbarton, thomie, carter GHC Trac Issues: #14078 Differential Revision: https://phabricator.haskell.org/D4532

Herbert Valerio Riedel authored
A common complaint with the new package environment files feature is that it's not obvious when package environments have been picked up. This patch applies the same strategy that was already used for `.ghci` files (which exhibit similar potential for confusion, c.f. #11389) to package environment files. For instance, this new notification looks like below for a GHCi invocation which loads both, a GHCi configuration as well as a package environment: GHCi, version 8.5.20180512: http://www.haskell.org/ghc/ :? for help Loaded package environment from /tmp/parsec3.1.13.0/.ghc.environment.x86_64linux8.5.20180512 Loaded GHCi configuration from /home/hvr/.ghci Prelude> Addresses #15145 Reviewed By: bgamari, angerman GHC Trac Issues: #15145 Differential Revision: https://phabricator.haskell.org/D4689

 12 May, 2018 4 commits


Ryan Scott authored
Summary: The parser's calculation of source spans for `EmptyCase` expressions was a bit off, leading to some wonkylooking error messages. Easily fixed with some uses of `comb3` and `sLL`. Test Plan: make test TEST=T15139 Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie, mpickering, carter GHC Trac Issues: #15139 Differential Revision: https://phabricator.haskell.org/D4685

Azel authored
Summary: Uses Win32's System.Win32.Console.CtrlHandler.withConsoleCtrlHandler to add to Windows's version of the timeout executable a CTRLC/CTRLBREAK handler which does the close IO port/kill job cleanup, just in case. Signedoffby: ARJANEN Loïc Jean David <arjanen.loic@gmail.com> Reviewers: Phyx, bgamari Reviewed By: Phyx Subscribers: dfeuer, thomie, carter GHC Trac Issues: #12721 Differential Revision: https://phabricator.haskell.org/D4631

Alp Mestanogullari authored
Summary: This requires adding an `sToolDir :: Maybe FilePath` field to Settings, since compilerInfo is pure and therefore needs to have all the information available in the DynFlags. This should fix #15101 and #15107. Test Plan: ./validate fast Reviewers: Phyx, bgamari Reviewed By: Phyx Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15101, #15107 Differential Revision: https://phabricator.haskell.org/D4686

 11 May, 2018 2 commits


niteria authored
See the new note. Test Plan: manual testing with patched gdb Reviewers: bgamari, simonmar, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4666

Ömer Sinan Ağacan authored

 10 May, 2018 3 commits


Simon Marlow authored
This reverts commit 5fe6aaa3.

Ömer Sinan Ağacan authored

Ömer Sinan Ağacan authored
We introduce a new Id for unused pointer values in unboxed sums that is not CAFFY. Because the Id is not CAFFY it doesn't make nonCAFFY definitions CAFFY, fixing #15038. To make sure anything referenced by the new id will be retained we get a stable pointer to in on RTS startup. Test Plan: Passes validate Reviewers: simonmar, simonpj, hvr, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15038 Differential Revision: https://phabricator.haskell.org/D4680

 09 May, 2018 1 commit


Simon Marlow authored
Summary: Space leaks in GHCi emerge from time to time and tend to come back again after they get fixed. This is an attempt to limit regressions by * adding a reliable detection for some classes of space leaks in GHCi * turning on leak checking for all GHCi tests in the test suite, so that we'll notice if the leak appears again. The idea for detecting space leaks is quite simple: * find some data that we expect to be GC'd later, make a weak pointer to it * when we expect the data to be dead, do a `performGC` and then check the status of the weak pointer. It would be nice to apply this trick to lots of things in GHC, e.g. ensuring that HsSyn is not retained after the desugarer, or ensuring that CoreSyn from the previous simplifier pass is not retained. Test Plan: validate Reviewers: bgamari, simonpj, erikd, niteria Subscribers: thomie, carter GHC Trac Issues: #15111 Differential Revision: https://phabricator.haskell.org/D4658

 08 May, 2018 8 commits


Tao He authored
Summary: The element type of `List` maybe a type family instacen, rather than a trivial type. For example in Trac #14547, ``` {# LANGUAGE TypeFamilies, OverloadedLists #} class Foo f where type It f foo :: [It f] > f data List a = Empty  a :! List a deriving Show instance Foo (List a) where type It (List a) = a foo [] = Empty foo (x : xs) = x :! foo xs ``` Here the element type of `[]` is `It (List a)`, we should also normalize it as `a`. Test Plan: make test TEST="T14547" Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #14547 Differential Revision: https://phabricator.haskell.org/D4624

Ben Gamari authored
This reverts commit 981bf471.

Ben Gamari authored
The element type of `List` maybe a type family instacen, rather than a trivial type. For example in Trac #14547, ``` {# LANGUAGE TypeFamilies, OverloadedLists #} class Foo f where type It f foo :: [It f] > f data List a = Empty  a :! List a deriving Show instance Foo (List a) where type It (List a) = a foo [] = Empty foo (x : xs) = x :! foo xs ``` Here the element type of `[]` is `It (List a)`, we should also normalize it as `a`. Test Plan: make test TEST="T14547" Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #14547 Differential Revision: https://phabricator.haskell.org/D4624

Ben Gamari authored
This reverts commit 361d23a8.

Ben Gamari authored
This discussion will be useful for users; move it into the usersguide proper. Also fixes a few typos noted by @Phyx. Test Plan: Read it Reviewers: Phyx Reviewed By: Phyx Subscribers: dfeuer, Phyx, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4420

Simon Peyton Jones authored
This patch deletes quite a bit of code, AND fixes Trac #15116.

Simon Peyton Jones authored

Simon Peyton Jones authored
This refactoring was provoked by our conversation on Trac #14152. No change in behaviour.

 06 May, 2018 6 commits


Ömer Sinan Ağacan authored

Ben Gamari authored
This was failing on Darwin; I believe this is due to 33de71fa.

Ben Gamari authored

Justus Sagemüller authored
This function was unstable, in particular for negative arguments. https://ghc.haskell.org/trac/ghc/ticket/14927 The reason is that the formula `log (x + sqrt (1 + x*x))` is dominated by the numerical error of the `sqrt` function when x is strongly negative (and thus the summands in the `log` mostly cancel). However, the area hyperbolic sine is an odd function, thus the negative side can as well be calculated by flipping over the positive side, which avoids this instability. Furthermore, for _very_ big arguments, the `x*x` subexpression overflows. However, long before that happens, the square root is anyways completely dominated by that term, so we can neglect the `1 +` and get sqrt (1 + x*x) ≈ sqrt (x*x) = x and therefore asinh x ≈ log (x + x) = log (2*x) = log 2 + log x which does not overflow for any normalfinite positive argument, but perfectly matches the exact formula within the floatingpoint accuracy.

Justus Sagemüller authored
The area hyperbolic sine is currently broken, see https://ghc.haskell.org/trac/ghc/ticket/14927.

Justus Sagemüller authored
These functions have inverses only on part of the real line, but there they should be reliably inverted – that's basically the whole point of the functions like `asin`, `atan` etc..

 05 May, 2018 10 commits


Sebastian Graf authored
This is mostly for congruence with 'subWordC#' and '{add,sub}IntC#'. I found 'plusWord2#' while implementing this, which both lacks documentation and has a slightly different specification than 'addWordC#', which means the generic implementation is unnecessarily complex. While I was at it, I also added lacking metainformation on PrimOps and refactored 'subWordC#'s generic implementation to be branchless. Reviewers: bgamari, simonmar, jrtc27, dfeuer Reviewed By: bgamari, dfeuer Subscribers: dfeuer, thomie, carter Differential Revision: https://phabricator.haskell.org/D4592

MitchellSalad authored

Moritz Angermann authored
Reviewers: bgamari Subscribers: thomie, carter GHC Trac Issues: #14982 Differential Revision: https://phabricator.haskell.org/D4548

Ben Gamari authored
Subscribers: thomie, carter, RyanGlScott GHC Trac Issues: #15067 Differential Revision: https://phabricator.haskell.org/D4622

Tao He authored
The element type of `List` maybe a type family instacen, rather than a trivial type. For example in Trac #14547, ``` {# LANGUAGE TypeFamilies, OverloadedLists #} class Foo f where type It f foo :: [It f] > f data List a = Empty  a :! List a deriving Show instance Foo (List a) where type It (List a) = a foo [] = Empty foo (x : xs) = x :! foo xs ``` Here the element type of `[]` is `It (List a)`, we should also normalize it as `a`. Test Plan: make test TEST="T14547" Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #14547 Differential Revision: https://phabricator.haskell.org/D4624

Andreas Klebinger authored
Splitting TrieMap into a general and core specific part allows us to define instances for TrieMap without creating a transitive dependency on CoreSyn. Test Plan: ci Reviewers: goldfire, bgamari, simonmar, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, nomeata, thomie, carter GHC Trac Issues: #15082 Differential Revision: https://phabricator.haskell.org/D4618

Ben Gamari authored
See #15086. [skipci]

Masahiro Sakai authored
`:'` in explanation text should be `':` to match code example.

Mark Karpov authored
The ‘haskell’ images are not being updated and there is no image with GHC 8.4.2, so we probably should not use them anymore. I adapted Dockerfiles used by those images so the end result is almost the same except we get newer GHC and cabalinstall.

Ben Gamari authored
This patch made the simplifier inline nested function bindings less aggressively and, while it didn't seem to affect nofib, appears to have regressed T9630 rather considerably.
