summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* Recommend more reliable recourse for broken nmBen Gamari2016-04-281-2/+1
| | | | | xcrun --find seems like the appropriate choice here. Thanks to Brandon Allbery for suggesting this.
* Document -fmax-pmcheck-iterations a bit betterBen Gamari2016-04-282-1/+13
|
* Doc improvement for ApplicativeDoSimon Marlow2016-04-261-0/+5
| | | | | Make it clearer that the final statement should be exactly "(return|pure) E".
* Warn about simplifiable class constraintsSimon Peyton Jones2016-04-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provoked by Trac #11948, this patch adds a new warning to GHC -Wsimplifiable-class-constraints It warns if you write a class constraint in a type signature that can be simplified by an existing instance declaration. Almost always this means you should simplify it right now; type inference is very fragile without it, as #11948 shows. I've put the warning as on-by-default, but I suppose that if there are howls of protest we can move it out (as happened for -Wredundant-constraints. It actually found an example of an over-complicated context in CmmNode. Quite a few tests use these weird contexts to trigger something else, so I had to suppress the warning in those. The 'haskeline' library has a few occurrences of the warning (which I think should be fixed), so I switched it off for that library in warnings.mk. The warning itself is done in TcValidity.check_class_pred. HOWEVER, when type inference fails we get a type error; and the error suppresses the (informative) warning. So as things stand, the warning only happens when it doesn't cause a problem. Not sure what to do about this, but this patch takes us forward, I think.
* Tighten checking for associated type instancesSimon Peyton Jones2016-04-191-15/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch finishes off Trac #11450. Following debate on that ticket, the patch tightens up the rules for what the instances of an associated type can look like. Now they must match the instance header exactly. Eg class C a b where type T a x b With this class decl, if we have an instance decl instance C ty1 ty2 where ... then the type instance must look like type T ty1 v ty2 = ... with exactly - 'ty1' for 'a' - 'ty2' for 'b', and - a variable for 'x' For example: instance C [p] Int type T [p] y Int = (p,y,y) Previously we allowed multiple instance equations and now, in effect, we don't since they would all overlap. If you want multiple cases, use an auxiliary type family. This is consistent with the treatment of generic-default instances, and the user manual always said "WARNING: this facility (multiple instance equations may be withdrawn in the future". I also improved error messages, and did other minor refactoring.
* relnotes: Add note about #11744 and workaroundBen Gamari2016-04-181-0/+8
| | | | | | | | | | | | Test Plan: Read it Reviewers: hvr, austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D2120 GHC Trac Issues: #11744
* Add flag to control number of missing patterns in warningsDavid Luposchainsky2016-04-171-1/+8
| | | | | | | | | | | | | | | | | | Non-exhaustive pattern warnings had their number of patterns to show hardcoded in the past. This patch implements the TODO remark that this should be made a command line flag. -fmax-uncovered-patterns=<n> can now be used to influence the number of patterns to be shown. Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2076
* users-guide: Fix typoBen Gamari2016-04-171-1/+1
|
* rel-notes: Add note about UndecidableSuperClasses and #11762Ben Gamari2016-04-151-0/+25
| | | | | | | | | | | | | | Test Plan: Read it Reviewers: austin, kosmikus Reviewed By: kosmikus Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2111 GHC Trac Issues: #11318, #11762
* users-guide: Note change in LLVM support policyBen Gamari2016-04-151-0/+5
|
* Fix #11797.Richard Eisenberg2016-04-121-0/+8
| | | | | | | DsMeta curiously omitted quantified tyvars in certain circumstances. This patch means it doesn't. Test case: th/T11797
* Change runtime linker to perform lazy loading of symbols/sectionsTamar Christina2016-04-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Runtime Linker is currently eagerly loading all object files on all platforms which do not use the system linker for `GHCi`. The problem with this approach is that it requires all symbols to be found. Even those of functions never used/called. This makes the number of libraries required to link things like `mingwex` quite high. To work around this the `rts` was relying on a trick. It itself was compiled with `MingW64-w`'s `GCC`. So it was already linked against `mingwex`. As such, it re-exported the symbols from itself. While this worked it made it impossible to link against `mingwex` in user libraries. And with this means no `C99` code could ever run in `GHCi` on Windows without having the required symbols re-exported from the rts. Consequently this rules out a large number of packages on Windows. SDL2, HMatrix etc. After talking with @rwbarton I have taken the approach of loading entire object files when a symbol is needed instead of doing the dependency tracking on a per symbol basis. This is a lot less fragile and a lot less complicated to implement. The changes come down to the following steps: 1) modify the linker to and introduce a new state for ObjectCode: `Needed`. A Needed object is one that is required for the linking to succeed. The initial set consists of all Object files passed as arguments to the link. 2) Change `ObjectCode`'s to be indexed but not initialized or resolved. This means we know where we would load the symbols, but haven't actually done so. 3) Mark any `ObjectCode` belonging to `.o` passed as argument as required: ObjectState `NEEDED`. 4) During `Resolve` object calls, mark all `ObjectCode` containing the required symbols as `NEEDED` 5) During `lookupSymbol` lookups, (which is called from `linkExpr` and `linkDecl` in `GHCI.hs`) is the symbol is in a not-yet-loaded `ObjectCode` then load the `ObjectCode` on demand and return the address of the symbol. Otherwise produce an unresolved symbols error as expected. 6) On `unloadObj` we then change the state of the object and remove it's symbols from the `reqSymHash` table so it can be reloaded. This change affects all platforms and OSes which use the runtime linker. It seems there are no real perf tests for `GHCi`, but performance shouldn't be impacted much. We gain a lot of time not loading all `obj` files, and we lose some time in `lookupSymbol` when we're finding sections that have to be loaded. The actual finding itself is O(1) (Assuming the hashtnl is perfect) It also consumes slighly more memory as instead of storing just the address of a symbol I also store some other information, like if the symbol is weak or not. This change will break any packages relying on renamed POSIX functions that were re-named and re-exported by the rts. Any packages following the proper naming for functions as found on MSDN will work fine. Test Plan: ./validate on all platforms which use the Runtime linker. Reviewers: thomie, rwbarton, simonmar, erikd, bgamari, austin, hvr Reviewed By: erikd Subscribers: kgardas, gridaphobe, RyanGlScott, simonmar, rwbarton, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1805 GHC Trac Issues: #11223
* Remove the instantiation check when deriving Generic(1)RyanGlScott2016-04-101-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, deriving `Generic(1)` bailed out when attempting to instantiate visible type parameters (#5939), but this instantiation check was quite fragile and doesn't interact well with `-XTypeInType`. It has been decided that `Generic(1)` shouldn't be subjected to this check anyway, so it has been removed, and `gen_Generic_binds`'s machinery has been updated to substitute the type variables in a generated `Rep`/`Rep1` instance with the user-supplied type arguments. In addition, this also refactors `Condition` in `TcDeriv` a bit. Namely, since we no longer need `tc_args` to check any conditions, the `[Type]` component of `Condition` has been removed. Fixes #11732. Test Plan: ./validate Reviewers: goldfire, kosmikus, simonpj, bgamari, austin Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2061 GHC Trac Issues: #5939, #11732
* Don't infer CallStacksEric Seidel2016-04-041-26/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally wanted CallStacks to be opt-in, but dealing with let binders complicated things, forcing us to infer CallStacks. It turns out that the inference is actually unnecessary though, we can let the wanted CallStacks bubble up to the outer context by refusing to quantify over them. Eventually they'll be solved from a given CallStack or defaulted to the empty CallStack if they reach the top. So this patch prevents GHC from quantifying over CallStacks, getting us back to the original plan. There's a small ugliness to do with PartialTypeSignatures, if the partial theta contains a CallStack constraint, we *do* want to quantify over the CallStack; the user asked us to! Note that this means that foo :: _ => CallStack foo = getCallStack callStack will be an *empty* CallStack, since we won't infer a CallStack for the hole in the theta. I think this is the right move though, since we want CallStacks to be opt-in. One can always write foo :: (HasCallStack, _) => CallStack foo = getCallStack callStack to get the CallStack and still have GHC infer the rest of the theta. Test Plan: ./validate Reviewers: goldfire, simonpj, austin, hvr, bgamari Reviewed By: simonpj, bgamari Subscribers: bitemyapp, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1912 GHC Trac Issues: #11573
* Make the example for -M workBartosz Nitka2016-04-011-1/+1
| | | | | | | | | | | | | | `ghc` fails without `-dep-suffix ''`. Test Plan: visual inspection Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D2075
* Don't require -hide-all-packages for MIN_VERSION_* macrosThomas Miedema2016-03-301-4/+2
| | | | | | | | | | | | | | | | | Define MIN_VERSION_pkgname and VERSION_pkgname macros for all exposed packages, without requiring -hide-all-packages. See #10970 comment 7-10 for discussion. Reviewers: duncan, ezyang, bgamari, austin Reviewed By: ezyang Subscribers: hvr, rwbarton Differential Revision: https://phabricator.haskell.org/D1869 GHC Trac Issues: #10970
* Do not claim that -O2 does not do better than -OJoachim Breitner2016-03-301-3/+0
| | | | | | | | | | | | when in fact it does. This was pointed out by Johannes Bechberger and supported with seemingly statistically sound evidence in his Bachelor thesis: Of the benchmark shootout programs, 80% benefit significantly by switchtng from -O to -O2. See https://uqudy.serpens.uberspace.de/blog/2016/02/08/ghc-performance-over-time/ for a few raw numbers. Differential Revision: https://phabricator.haskell.org/D2065
* Typos in non-codeGabor Greif2016-03-302-2/+2
|
* users-guide/rel-notes: Note broken-ness of ImpredicativeTypesBen Gamari2016-03-291-0/+8
|
* users-guide: Add references to various issues in bugs sectionBen Gamari2016-03-291-0/+37
| | | | | | | | | | | | | | Test Plan: Read it Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2052 GHC Trac Issues: #7411, #11197, #11554, #11715
* users-guide: WibblesBen Gamari2016-03-291-6/+34
|
* users-guide: Provide more depth in table-of-contentsBen Gamari2016-03-291-1/+1
| | | | Per Simon's request.
* DWARF: Add debugging information chapter to users guideBen Gamari2016-03-262-0/+315
| | | | | | | | | | Test Plan: Proof-read Reviewers: scpmw, austin Subscribers: simonmar, thomie Differential Revision: https://phabricator.haskell.org/D1369
* More clarification in docs for implicit quantificationSimon Peyton Jones2016-03-251-1/+13
| | | | | | This is a follow-up patch to the previous one for #11726. It turns out that I'd missed the point of the ticket; this patch addresses it.
* Document implicit quantification betterSimon Peyton Jones2016-03-251-4/+5
| | | | Addresses Trac #11726
* Add option `no-keep-hi-files` and `no-keep-o-files` (fixes #4114)Kai Harries2016-03-241-2/+19
| | | | | | | | | | | | | | | | | Summary: Remove `.hi` and `.o` files if the flags `no-keep-hi-files` and `no-keep-o-files` are given. Test Plan: ./validate Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2021 GHC Trac Issues: #4114
* users_guide: small improvements on pattern synonyms.Dominik Bollmann2016-03-241-11/+15
| | | | | | | | | | | | | | Since the order of required and provided constraint contexts of pattern synonyms has been switched recently, I updated a couple places in the users guide's pattern synonym section to accommodate for this. Test Plan: read it :-) Reviewers: goldfire, thomie, mpickering, simonpj, austin, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D2034
* users-guide: Add -Wredundant-constraints to flags referenceBen Gamari2016-03-241-0/+2
| | | | | | | | | | | | Test Plan: Validate and read Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2035 GHC Trac Issues: #11741
* users_guide: Fix various issuesBen Gamari2016-03-241-7/+11
| | | | | | | | | | | | | Sphinx apparently expects references to anchors that don't accompany a header to have a caption. Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2033
* Default RuntimeRep variables unless -fprint-explicit-runtime-repsBen Gamari2016-03-241-0/+16
| | | | | | | | | | | | | | | | | | | | Summary: Addresses #11549 by defaulting `RuntimeRep` variables to `PtrRepLifted` and adding a new compiler flag `-fprint-explicit-runtime-reps` to disable this behavior. This is just a guess at the right way to go about this. If it's wrong-beyond-any-hope just say so. Test Plan: Working on a testcase Reviewers: goldfire, austin Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1961 GHC Trac Issues: #11549
* Show: Restore redundant parentheses around recordsBen Gamari2016-03-241-0/+15
| | | | | | | | | | | | | | | | | | | | As discussed in #2530 we are going to continue to produce parentheses here in order to preserve compatibility with previous GHC releases. It was found that dropped parentheses would break some testsuites which compared against output from Show. This has been documented in the users guide. This reverts commit 5692643c9d17e746327588cd6157a923642b7975. Test Plan: Validate Reviewers: hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2027 GHC Trac Issues: #2350
* Add unicode syntax for banana bracketsJosh Price2016-03-241-0/+4
| | | | | | | | | | | | | | | | | | | | | Summary: Add "⦇" and "⦈" as unicode alternatives for "(|" and "|)" respectively. This must be implemented differently than other unicode additions because ⦇" and "⦈" are interpretted as a $unigraphic rather than a $unisymbol. Test Plan: validate Reviewers: goldfire, bgamari, austin Reviewed By: bgamari, austin Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2012 GHC Trac Issues: #10162
* ErrUtils: Add timings to compiler phasesBen Gamari2016-03-242-3/+11
| | | | | | | | | | | | | | | | | | | | | | | This adds timings and allocation figures to the compiler's output when run with `-v2` in an effort to ease performance analysis. Todo: * Documentation * Where else should we add these? * Perhaps we should remove some of the now-arguably-redundant `showPass` occurrences where they are * Must we force more? * Perhaps we should place this behind a `-ftimings` instead of `-v2` Test Plan: `ghc -v2 Test.hs`, look at the output Reviewers: hvr, goldfire, simonmar, austin Reviewed By: simonmar Subscribers: angerman, michalt, niteria, ezyang, thomie Differential Revision: https://phabricator.haskell.org/D1959
* Fix #11723 and #11724.Richard Eisenberg2016-03-211-1/+1
| | | | Test cases: typecheck/should_fail/T1172{3,4}
* Track specified/invisible more carefully.Richard Eisenberg2016-03-211-0/+13
| | | | | | | | | | | | | | In particular, this allows correct tracking of specified/invisible for variables in Haskell98 data constructors and in pattern synonyms. GADT-syntax constructors are harder, and are left until #11721. This was all inspired by Simon's comments to my fix for #11512, which this subsumes. Test case: ghci/scripts/TypeAppData [skip ci] (The test case fails because of an unrelated problem fixed in the next commit.)
* TypeApplications does not imply AllowAmbiguousTypesRichard Eisenberg2016-03-211-1/+0
|
* Incorporate bgamari's suggestions for #11614.Richard Eisenberg2016-03-152-18/+43
|
* Fix #11648.Richard Eisenberg2016-03-141-9/+53
| | | | | | | | | | | | We now check that a CUSK is really a CUSK and issue an error if it isn't. This also involves more solving and zonking in kcHsTyVarBndrs, which was the outright bug reported in #11648. Test cases: polykinds/T11648{,b} This updates the haddock submodule. [skip ci]
* Document TypeInType (#11614)Richard Eisenberg2016-03-142-272/+602
| | | | [skip ci]
* Move and expand (slightly) TypeApplications docsRichard Eisenberg2016-03-141-66/+77
| | | | [skip ci]
* users_guide: Break up -fprint-* descriptionBen Gamari2016-03-131-16/+22
| | | | | This makes it a bit easier to find the description corresponding to particular flags.
* ghci: add message when reusing compiled code #9887Alexander Lukyanov2016-03-121-2/+2
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1991 GHC Trac Issues: #9887
* Add -foptimal-applicative-doSimon Marlow2016-03-111-0/+17
| | | | | | | | | | | | | | | | | | | | Summary: The algorithm for ApplicativeDo rearrangement is based on a heuristic that runs in O(n^2). This patch adds the optimal algorithm, which is O(n^3), selected by a flag (-foptimal-applicative-do). It finds better solutions in a small number of cases (about 2% of the cases where ApplicativeDo makes a difference), but it can be very slow for large do expressions. I'm mainly adding it for experimental reasons. ToDo: user guide docs Test Plan: validate Reviewers: simonpj, bgamari, austin, niteria, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1969
* Add ghc-flag directory for -XPatternGuardsBen Gamari2016-03-111-5/+9
| | | | | | | | Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1987
* Document Quasi-quotes/list comprehension ambiguityBen Gamari2016-03-111-1/+27
| | | | | | | | | | | | | | Test Plan: read it Reviewers: austin, goldfire Reviewed By: goldfire Subscribers: hvr, thomie Differential Revision: https://phabricator.haskell.org/D1981 GHC Trac Issues: #11679
* users-guide: Mention #11558 in release notesBen Gamari2016-03-051-2/+2
|
* Default to -fno-show-warning-groups (re #10752)Herbert Valerio Riedel2016-02-271-3/+4
| | | | | | | | | | | | | | | | | | As `-fno-show-warning-groups` shows associated warning groups regardless of whether the respective warning group flag as been passed on the CLI, the warning-group information may be confusing to users. At this point, `-fshow-warning-groups` is useful mostly to GHC developers and possibly GHC users who want to see which warning groups an emitted warning is part of. (Btw, this is particularly interesting in combination with `-Weverything` which enables *every* warning flag known to GHC.) Consequently, starting with this commit, one has to opt-in via `-fshow-warning-groups` for GHC to show warning groups. In order to reduce the testsuite delta in this commit, the `-fshow-warning-groups` flag has been added to TEST_HC_OPTS.
* Fix and refactor strict pattern bindingsSimon Peyton Jones2016-02-261-16/+18
| | | | | | | | | | | | | | | | | | | | | | This patch was triggered by Trac #11601, where I discovered that -XStrict was really not doing the right thing. In particular, f y = let !(Just x) = blah[y] in body[y,x] This was evaluating 'blah' but not pattern matching it against Just until x was demanded. This is wrong. The patch implements a new semantics which ensures that strict patterns (i.e. ones with an explicit bang, or with -XStrict) are evaluated fully when bound. * There are extensive notes in DsUtils: Note [mkSelectorBinds] * To do this I found I need one-tuples; see Note [One-tuples] in TysWiredIn I updated the user manual to give the new semantics
* Typos in comments, etc.Gabor Greif2016-02-261-1/+1
|
* Print which warning-flag controls an emitted warningMichael Walker2016-02-251-0/+9
| | | | | | | | | | | | | | | | | Both gcc and clang tell which warning flag a reported warning can be controlled with, this patch makes ghc do the same. More generally, this allows for annotated compiler output, where an optional annotation is displayed in brackets after the severity. This also adds a new flag `-f(no-)show-warning-groups` to control whether to show which warning-group (such as `-Wall` or `-Wcompat`) a warning belongs to. This flag is on by default. This implements #10752 Reviewed By: quchen, bgamari, hvr Differential Revision: https://phabricator.haskell.org/D1943