summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* User's guide: Fix the category of some flagsJoachim Breitner2017-10-194-13/+17
| | | | so now “7.6.12. Language options” only lists `-X` flags, as it should.
* Export injectiveVarsOf{Binder,Type} from TyCoRepRyan Scott2017-10-192-29/+36
| | | | | | | | | | | | | | | | | | Summary: I ended up needing to use the functionality of `injectiveVarsOfBinder`/`injectiveVarsOfType` in this Haddock PR (https://github.com/haskell/haddock/pull/681), but alas, neither of these functions were exported. Let's do so. Test Plan: Does it compile? Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4107
* Fix #14369 by making injectivity warnings finer-grainedRyan Scott2017-10-1916-27/+58
| | | | | | | | | | | | | | | | | | | | | Summary: Previously, GHC would always raise the possibility that a type family might not be injective in certain error messages, even if that type family actually //was// injective. Fix this by actually checking for a type family's lack of injectivity before emitting such an error message. Test Plan: ./validate Reviewers: goldfire, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #14369 Differential Revision: https://phabricator.haskell.org/D4106
* Error when deriving instances in hs-boot filesRyan Scott2017-10-197-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | Summary: According to the GHC users' guide, one cannot derive instances for data types in `.hs-boot` files. However, GHC was not enforcing this in practice, which led to #14365. Fix this by actually throwing an error if a derived instance is detected in an `.hs-boot` file (and recommend how to fix it in the error message.) Test Plan: make test TEST=T14365 Reviewers: ezyang, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #14365 Differential Revision: https://phabricator.haskell.org/D4102
* Disable -XRebindableSyntax when running internal GHCi expressionsRyan Scott2017-10-193-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It's well known that `-XRebindableSyntax` doesn't play nicely with some of the internal expressions that GHCi runs. #13385 was one example where this problem arose, which was fixed at the time by simply avoiding the use of `do`-notation in these internal GHCi expressions. That seemed to work, but it was a technique that proved not to scale, as #14342 demonstrated //another// example where `-XRebindableSyntax` can bite. Instead of delicately arranging the internal GHCi expressions to avoid anything that might be covered under `-XRebindableSyntax`, this patch takes the much more direct approach of disabling `-XRebindableSyntax` entirely when running any internal GHCi expression. This shouldn't hurt, since nothing internal to GHCi was taking advantage of the extension in the first place, and moreover, we can have greater confidence that some other obscure `-XRebindableSyntax` corner case won't pop up in the future. As an added bonus, this lets us once again use `do`-notation in the code that had to be changed when #13385 was (hackily) fixed before. Test Plan: make test TEST=T14342 Reviewers: bgamari, austin Subscribers: rwbarton, thomie GHC Trac Issues: #14342 Differential Revision: https://phabricator.haskell.org/D4086
* Accept test output for #14350Ryan Scott2017-10-191-0/+30
|
* whitespace onlyGabor Greif2017-10-181-2/+1
|
* Typofix in commentGabor Greif2017-10-181-1/+1
|
* Better solving for representational equalitiesSimon Peyton Jones2017-10-187-179/+252
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a bit of extra solving power for representational equality constraints to fix Trac #14333 The main changes: * Fix a buglet in TcType.isInsolubleOccursCheck which wrongly reported a definite occurs-check error for (a ~R# b a) * Get rid of TcSMonad.emitInsolubles. It had an ad-hoc duplicate-removal piece that is better handled in interactIrred, now that insolubles are Irreds. We need a little care to keep inert_count (which does not include insolubles) accurate. * Refactor TcInteract.solveOneFromTheOther, to return a much simpler type. It was just over-complicated before. * Make TcInteract.interactIrred look for constraints that match either way around, in TcInteract.findMatchingIrreds This wasn't hard and it cleaned up quite a bit of code.
* Don't deeply expand insolublesSimon Peyton Jones2017-10-183-6/+76
| | | | | | | | | Trac #13450 went bananas if we expand insoluble constraints. Better just to leave them un-expanded. I'm not sure in detail about why it goes so badly wrong; but regardless, the less we mess around with insoluble contraints the better the error messages will be.
* Improve user’s guide around derivingJoachim Breitner2017-10-171-65/+120
| | | | | | | | | | | | In particular: * add an intro to “10.6. Extensions to the “deriving” mechanism” giving an overview, * make the various sections on `-XDerivingFoo` subsections of “10.6.3. Deriving instances of extra classes (Data, etc.)” * Move the reference anchors for the various `DerivingFoo` extensions to a more appropriate spot. * Add subsection “10.6.6.1. Default deriving strategy” to the deriving section (#14357)
* Fix grammaros in commentsGabor Greif2017-10-174-4/+4
|
* Simplify, no functionality changeGabor Greif2017-10-171-7/+6
|
* Bump ghc-prim to 0.5.2.0 and update changelogHerbert Valerio Riedel2017-10-1765-67/+77
| | | | | | | This is prompted by the addition of `compareByteArrays#` in e3ba26f8b49700b41ff4672f3f7f6a4e453acdcc NOTE: We may switch to synchronise `ghc-prim` with GHC's version at some point
* users-guide: Clarify -ddump-asm-regalloc-stages documentationBen Gamari2017-10-161-2/+4
| | | | [skip ci]
* updateThunk: indirectee can be taggedJames Clarke2017-10-161-1/+1
| | | | | | | | | | Reviewers: austin, bgamari, erikd, simonmar, trofi Reviewed By: trofi Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4100
* Flags.hsc: Peek a CBool (Word8), not a Bool (Int32)James Clarke2017-10-161-39/+78
| | | | | | | | | | Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4093
* ghci: Include "Rts.h" before using TABLES_NEXT_TO_CODEBen Gamari2017-10-161-3/+3
| | | | | | | | Reviewers: austin Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4088
* RtClosureInspect: Fix inspecting Char# on 64-bit big-endianJames Clarke2017-10-162-3/+5
| | | | | | | | | | | | | | | | | Char# is represented with a full machine word, whereas Char's Storable instance uses an Int32, so we can't just treat it like a single-element Char array. Instead, read it as an Int and use chr to turn it into a Char. This fixes Trac #11262. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #11262 Differential Revision: https://phabricator.haskell.org/D4089
* rts/posix: Ensure that memory commit succeedsBen Gamari2017-10-161-1/+4
| | | | | | | | | | | | | | | | | Previously we wouldn't check that mmap would succeed. I suspect this may have been the cause of #14329. Test Plan: Validate under low-memory condition Reviewers: simonmar, austin, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #14329 Differential Revision: https://phabricator.haskell.org/D4075
* users-guide: Fix various warningsBen Gamari2017-10-162-2/+2
| | | | [skip ci]
* users guide: Eliminate redundant :category: tags in debugging.rstBen Gamari2017-10-161-85/+4
| | | | The categories in this file are defined in flags.py.
* users-guide: Rework and finish debug flag documentationBen Gamari2017-10-161-267/+429
| | | | | | This documentation was incomplete and not terribly well organized. Given that I've spent a lot of time searching through this page, I figured it is perhaps worth it to clean it up a bit.
* rts: Label all threads created by the RTSBen Gamari2017-10-164-14/+23
| | | | | | | | | | Reviewers: austin, erikd, simonmar Reviewed By: simonmar Subscribers: pacak, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4068
* FreeBSD dtrace probe supportBen Gamari2017-10-163-8/+43
| | | | | | | | | | Reviewers: austin, hvr, erikd, simonmar, bgamari Reviewed By: bgamari Subscribers: snowleopard, raichoo, rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D3994
* Levity polymorphic Backpack.Edward Z. Yang2017-10-1610-16/+107
| | | | | | | | | | | | | | | | | | | | | This patch makes it possible to specify non * kinds of abstract data types in signatures, so you can have levity polymorphism through Backpack, without the runtime representation constraint! Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: andrewthad, bgamari, austin, goldfire Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie GHC Trac Issues: #13955 Differential Revision: https://phabricator.haskell.org/D3825
* configure: Fix CC version check on Apple compilersBen Gamari2017-10-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | It seems that some Apple LLVM wrappers emit multiple messages containing the string "version", which we previously used to find the version number. For instance, Configured with: --prefix=/Applications/Xcode.app/Contents/... Apple LLVM version 9.0.0 (clang-900.0.37) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/... Found CUDA installation: /usr/local/cuda, version 8.0 We now take care to only look at the first occurrence of this string. New `sed` command due to @merijn. Test Plan: Validate on all the compilers Reviewers: austin, hvr Subscribers: rwbarton, thomie, merijn, erikd Differential Revision: https://phabricator.haskell.org/D4069
* Implement {set,clear,complement}BitBigNat primitivesHerbert Valerio Riedel2017-10-163-14/+97
| | | | | | | | | | | | | | This implements the missing `{set,clear,complement}BitBigNat` primitives and hooks them up to `Natural`'s `Bits` instance. This doesn't yet benefit `Integer`, as we still need "negative" `BigNat` variants of those primitives. Addresses #7860 (partly) Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D3415
* Enable testing 'Natural' type in TEST=arith011Herbert Valerio Riedel2017-10-163-4/+1341
| | | | This now passes thanks to 5984a698fc2974b719365a9647a7cae1bed51eec (re #13203)
* Override default `clearBit` method impl for `Natural`Herbert Valerio Riedel2017-10-161-0/+5
| | | | | | | | | | | | The default implementation of `clearBit` is in terms of `complement`. However, `complement` is not well-defined for `Natural` and this consequently renders the default implementation of `clearBit` dysfunctional. This implements `clearBit` in terms of `testBit` and `setBit` which are both well-defined for `Natural`s. This addresses #13203
* Implement new `compareByteArrays#` primopHerbert Valerio Riedel2017-10-167-3/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new primop compareByteArrays# :: ByteArray# -> Int# {- offset -} -> ByteArray# -> Int# {- offset -} -> Int# {- length -} -> Int# allows to compare the subrange of the first `ByteArray#` to the (same-length) subrange of the second `ByteArray#` and returns a value less than, equal to, or greater than zero if the range is found, respectively, to be byte-wise lexicographically less than, to match, or be greater than the second range. Under the hood, the new primop is implemented in terms of the standard ISO C `memcmp(3)` function. It is currently an out-of-line primop but work is underway to optimise this into an inline primop for a future follow-up Differential (see D4091). This primop has applications in packages like `text`, `text-short`, `bytestring`, `text-containers`, `primitive`, etc. which currently have to incur the overhead of an ordinary FFI call to directly or indirectly invoke `memcmp(3)` as well has having to deal with some `unsafePerformIO`-variant. While at it, this also improves the documentation for the existing `copyByteArray#` primitive which has a non-trivial type-signature that significantly benefits from a more explicit description of its arguments. Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4090
* Fix panic for `ByteArray#` arguments in CApiFFI foreign importsHerbert Valerio Riedel2017-10-164-0/+33
| | | | | | | | | | | | | | | | | | | | Declarations such as foreign import capi unsafe "string.h strlen" c_strlen_capi :: ByteArray# -> IO CSize foreign import capi unsafe "string.h memset" c_memset_capi :: MutableByteArray# s -> CInt -> CSize -> IO () would cause GHC to panic because the CApiFFI c-wrapper generator didn't know what C type to use for `(Mutable)ByteArray#` types (unlike the `ccall` codepath). This addresses #9274 Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4092
* Fix typoPeter Trommler2017-10-161-1/+1
|
* Fix typoPeter Trommler2017-10-161-1/+1
|
* Fix calculation in threadStackOverflowSimon Marlow2017-10-161-2/+2
| | | | | | | | | | | | | | | Summary: The calculation was too conservative, and could result in copying zero frames into the new stack chunk, which caused a knock-on failure in the interpreter. Test Plan: Tested on an in-house repro (not shareable, unfortunately) Reviewers: niteria, bgamari, austin, erikd Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4052
* Remove section about ApplicativeDo & existentials (#13875)Simon Marlow2017-10-151-40/+0
| | | | | | | | | | | | | | | | | | | Summary: This section is irrelevant now that strict pattern matches don't get the ApplicativeDo treatment. Test Plan: ``` make html FAST=YES ``` Reviewers: bgamari, austin, erikd Subscribers: rwbarton, thomie GHC Trac Issues: #13875 Differential Revision: https://phabricator.haskell.org/D4087
* Delete obsolete docs on GADT interacton with TypeApplicationsRyan Scott2017-10-131-16/+0
| | | | | | | | | Even since ef26182e2014b0a2a029ae466a4b121bf235e4e4, this section of the users' guide is wrong, as there are no longer special rules for the order of type variables in GADT constructors' type signatures vis-à-vis visible type application. As a result, this section can simply be deleted, as there is no longer anything interesting to say about the topic.
* Re-apply "Typeable: Allow App to match arrow types"Simon Peyton Jones2017-10-125-6/+88
| | | | | | | | | | | | | | This re-applies commit cc6be3a2f23c9b2e04f9f491099149e1e1d4d20b Author: Ben Gamari <bgamari.foss@gmail.com> Date: Tue Sep 19 18:57:38 2017 -0400 Typeable: Allow App to match arrow types which was reverted because of Trac #14270. Now the latter is fixed we can re-apply it. The original ticket was Trac #14236
* Do not bind coercion variables in SpecConstr rulesSimon Peyton Jones2017-10-123-2/+70
| | | | | | | | | | | | | | | | Trac #14270 showed that SpecConstr could cause nasty Lint failures if it generates a RULE that binds coercion varables. See * Note [SpecConstr and casts], and * the test simplCore/should_compile/T14270. This doesn't feel like the final word to me, because somehow the specialisation "ought" to work. So I left in a debug WARN to yell if the new check acutally fires. Meanwhile, it stops the erroneous specialisation. binding coercion
* Add missing T14325.stderrSimon Peyton Jones2017-10-121-0/+9
|
* Do not quantify over deriving clausesSimon Peyton Jones2017-10-123-9/+24
| | | | | | | | | | | | Trac #14331 showed that in a data type decl like data D = D deriving (C (a :: k)) we were quantifying D over the 'k' in the deriving clause. Yikes. Easily fixed, by deleting code in RnTypes.extractDataDefnKindVars See the discussion on the ticket, esp comment:8.
* Add a missing zonk in TcDerivInfer.simplifyDerivSimon Peyton Jones2017-10-113-0/+20
| | | | | | I'm astonished that anything worked without this! Fixes Trac #14339
* Avoid creating dependent types in FloatOutSimon Peyton Jones2017-10-113-20/+172
| | | | | | | | This bug was exposed by Trac #14270. The problem and its cure is described in SetLevels, Note [Floating and kind casts]. It's simple and will affect very few programs. But the very fact that it was so unexpected is discomforting.
* Pretty-printing of derived multi-parameter classes omits parenthesesAlan Zimmerman2017-10-1111-6/+219
| | | | | | | | | | | | | | | | | | | Summary: Pretty printing a splice with an HsAppType in the deriving clause, such as $([d| data Foo a = Foo a deriving (C a) |]) would omit the parens. Test Plan: ./validate Reviewers: RyanGlScott, austin, bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14289 Differential Revision: https://phabricator.haskell.org/D4056
* Fix #10816 by renaming FixitySigs more consistentlyRyan Scott2017-10-114-45/+50
| | | | | | | | | | | | | | | | | | | | | Summary: #10816 surfaced because we were renaming top-level fixity declarations with a different code path (`rnSrcFixityDecl`) than the code path for fixity declarations inside of type classes, which is not privy to names that exist in the type namespace. Luckily, the fix is simple: use `rnSrcFixityDecl` in both places. Test Plan: make test TEST=T10816 Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #10816 Differential Revision: https://phabricator.haskell.org/D4077
* Remove wc_insol from WantedConstraintsSimon Peyton Jones2017-10-1119-249/+281
| | | | | | | | | | | | | | | | | | | | | | | | This patch is a pure refactoring, which I've wanted to do for some time. The main payload is * Remove the wc_insol field from WantedConstraints; instead put all the insolubles in wc_simple * Remove inert_insols from InertCans Instead put all the insolubles in inert_irreds * Add a cc_insol flag to CIrredCan, to record that the constraint is definitely insoluble Reasons * Quite a bit of code gets slightly simpler * Fewer concepts to keep separate * Insolubles don't happen at all in production code that is just being recompiled, so previously there was a lot of moving-about of empty sets A couple of error messages acutally improved.
* Delete two unused functionsSimon Peyton Jones2017-10-112-13/+1
| | | | | | | | Delete unused functions pprArrowChain pprPrefixApp from TyCoRep
* Change "cobox" to "co" in debug outputSimon Peyton Jones2017-10-111-1/+1
| | | | | These coercions are /not/ boxed, so "cobox" is positively misleading. And it's longer than necessary.
* Fix over-eager error suppression in TcErrorsSimon Peyton Jones2017-10-113-2/+34
| | | | | | See Note [Given insolubles] in TcRnTypes Fixes Trac #14325.
* Minor refactoringSimon Peyton Jones2017-10-111-16/+16
| | | | | I'm trying to understand Check.hs. This patch is a very minor refactoring. No change in behaviour.