summaryrefslogtreecommitdiff
path: root/docs
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Note new GHC.Generics instances in release notesBen Gamari2016-02-251-0/+5
|
* Make warning names more consistentManav Rathi2016-02-253-19/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace "Sigs" with "Signatures" in WarningFlag data constructors. - Replace "PatSyn" with "PatternSynonym" in WarningFlag data constructors. - Deprecate "missing-local-sigs" in favor of "missing-local-signatures". - Deprecate "missing-exported-sigs" in favor of "missing-exported-signatures". - Deprecate "missing-pat-syn-signatures" in favor of "missing-pattern-synonym-signatures". - Replace "ddump-strsigs" with "ddump-str-signatures" These complete the tasks that were explicitly mentioned in #11583 Test Plan: Executed `ghc --show-options` and verified that the flags were changed as expected. Reviewers: svenpanne, austin, bgamari Reviewed By: austin, bgamari Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D1939 GHC Trac Issues: #11583
* ApplicativeDo: Handle terminal `pure` statementsBen Gamari2016-02-251-1/+2
| | | | | | | | | | | | | | | | | ApplicativeDo handled terminal `return` statements properly, but not `pure`. Test Plan: Validate with included testcase Reviewers: austin, simonmar Reviewed By: austin, simonmar Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1931 GHC Trac Issues: #11607
* Overload the static form to reduce verbosity.Facundo Domínguez2016-02-251-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Static pointers are rarely used naked: most often they are defined at the base of a Closure, as defined in e.g. the distributed-closure and distributed-static packages. So a typical usage pattern is: distributeMap (closure (static (\x -> x * 2))) which is more verbose than it needs to be. Ideally we'd just have to write distributeMap (static (\x -> x * 2)) and let the static pointer be lifted to a Closure implicitly. i.e. what we want is to overload static literals, just like we already overload list literals and string literals. This is achieved by introducing the IsStatic type class and changing the typing rule for static forms slightly: static (e :: t) :: IsStatic p => p t Test Plan: ./validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: simonpj, mboes, thomie Differential Revision: https://phabricator.haskell.org/D1923 GHC Trac Issues: #11585
* Docs: -keep-llvm-file(s)/-ddump-llvm imply -fllvmThomas Miedema2016-02-222-0/+7
| | | | This fixes #9917.
* Fix desugaring of bang-pattern let-bindingsSimon Peyton Jones2016-02-181-414/+388
| | | | | | | | | | | | | When implementing Strict Haskell, the patch 46a03fbe didn't faithfully implement the semantics given in the manual. In particular there was an ad-hoc case in mkSelectorBinds for "strict and no binders" that didn't work. This patch fixes it, curing Trac #11572. Howver it forced me to think about banged let-bindings, and I rather think we do not have quite the right semantics yet, so I've opened Trac #11601.
* users-guide: Fix typosMark Christiaens2016-02-171-4/+4
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1927 GHC Trac Issues: #11590
* Remove superfluous code when deriving Foldable/TraversableRyanGlScott2016-02-172-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, `-XDeriveFoldable` and `-XDeriveTraversable` generate unnecessary `mempty` and `pure` expressions when it traverses of an argument of a constructor whose type does not mention the last type parameter. Not only is this inefficient, but it prevents `Traversable` from being derivable for datatypes with unlifted arguments (see Trac #11174). The solution to this problem is to adopt a slight change to the algorithms for `-XDeriveFoldable` and `-XDeriveTraversable`, which is described in [this wiki page](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DeriveFu nctor#Proposal:alternativestrategyforderivingFoldableandTraversable). The wiki page also describes why we don't apply the same changes to the algorithm for `-XDeriveFunctor`. This is techincally a breaking change for users of `-XDeriveFoldable` and `-XDeriveTraversable`, since if someone was using a law-breaking `Monoid` instance with a derived `Foldable` instance (i.e., one where `x <> mempty` does not equal `x`) or a law-breaking `Applicative` instance with a derived `Traversable` instance, then the new generated code could result in different behavior. I suspect the number of scenarios like this is very small, and the onus really should be on those users to fix up their `Monoid`/`Applicative` instances. Fixes #11174. Test Plan: ./validate Reviewers: hvr, simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1908 GHC Trac Issues: #11174
* Remove documentation for -Wlazy-unlifted-bindingsBen Gamari2016-02-161-4/+0
| | | | | | | | | | | | | | | | | This flag was supposed to be removed in 7.10. This finally resolves Trac #8022. Test Plan: Read it Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1922 GHC Trac Issues: #8022
* Fix typosRik Steenkamp2016-02-161-5/+5
| | | | | | | | | | Reviewers: bgamari, austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1915
* Rename missing-pat-syn-sigs to missing-pat-syn-signaturesMatthew Pickering2016-02-152-3/+3
|
* Document -dynamic-too (#11488)Simon Marlow2016-02-151-0/+14
|
* User manual improvmentsSimon Peyton Jones2016-02-121-867/+879
| | | | | | | | - Document that you can use 'forall' in instance decls - Change the sections a bit, so that big sections (like lexically scoped type variables, pattern synonyms, implicit parameters) become more visible
* docs: add newline after '.. ghc-flag::'Sergei Trofimovich2016-02-101-0/+3
| | | | | | | | Noticed when looked through sphinx warnings: docs/users_guide/safe_haskell.rst:4: SEVERE: Duplicate ID: "ghc-flag-Issue" Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Expand users' guide TH declaration groups section (#9813)Owen Stephens2016-02-101-21/+57
| | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1899
* release notes: Note new two-step allocatorBen Gamari2016-02-081-0/+7
|
* user-guide: Add cross-reference for -XUnicodeSyntaxBen Gamari2016-02-081-1/+1
|
* rts: drop unused 'traverseAllRetainerSet'Sergei Trofimovich2016-02-071-2/+0
| | | | | | | | | | | | While at is mark 'printRetainer' as 'static'. Noticed by uselex.rb: printRetainer: [R]: exported from: ./rts/dist/build/RetainerSet.p_o traverseAllRetainerSet: [R]: exported from: ./rts/dist/build/RetainerSet.p_o Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Fix a few loose ends from D1795Ben Gamari2016-02-041-0/+8
| | | | George updated the Diff but I didn't noticed until it was too late.
* Overhaul the Overhauled Pattern Match CheckerGeorge Karachalias2016-02-043-53/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overhaul the Overhauled Pattern Match Checker * Changed the representation of Value Set Abstractions. Instead of using a prefix tree, we now use a list of Value Vector Abstractions. The set of constraints Delta for every Value Vector Abstraction is the oracle state so that we solve everything only once. * Instead of doing everything lazily, we prune at once (and in general everything is much stricter). Hence, an example written with pattern guards is checked in almost the same time as the equivalent with pattern matching. * Do not store the covered and the divergent sets at all. Since what we only need is a yes/no (does this clause cover anything? Does it force any thunk?) We just keep a boolean for each. * Removed flags `-Wtoo-many-guards` and `-ffull-guard-reasoning`. Replaced with `fmax-pmcheck-iterations=n`. Still debatable what should the default `n` be. * When a guard is for sure not going to contribute anything, we treat it as such: The oracle is not called and cases `CGuard`, `UGuard` and `DGuard` from the paper are not happening at all (the generation of a fresh variable, the unfolding of the pattern list etc.). his combined with the above seems to be enough to drop the memory increase for test T783 down to 18.7%. * Do not export function `dsPmWarn` (it is now called directly from within `checkSingle` and `checkMatches`). * Make `PmExprVar` hold a `Name` instead of an `Id`. The term oracle does not handle type information so using `Id` was a waste of time/space. * Added testcases T11195, T11303b (data families) and T11374 The patch addresses at least the following: Trac #11195, #11276, #11303, #11374, #11162 Test Plan: validate Reviewers: goldfire, bgamari, hvr, austin Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1795
* Make TypeError a newtype, add changelog entryRyanGlScott2016-02-021-0/+8
| | | | | | | | | | | | | | | | | | Summary: Phab:D866 added the `TypeError` datatype to `Control.Exception` to represent the error that is thrown when `-fdefer-type-errors` is on, but a changelog entry for it was never added. In addition, it should probably be a newtype. Reviewers: austin, hvr, KaneTW, bgamari Reviewed By: KaneTW, bgamari Subscribers: thomie, KaneTW Differential Revision: https://phabricator.haskell.org/D1873 GHC Trac Issues: #10284
* Typo in docsBen Gamari2016-02-011-2/+2
| | | | | | | | | | | | | | | Spelling mistakes fixed, * identiy > identity * suprising > surprising Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1871
* Hide the CallStack implicit parameterEric Seidel2016-02-013-94/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implicit parameter isn't actually very relevant to the CallStack machinery, so we hide the implementation details behind a constraint alias ``` type HasCallStack = (?callStack :: CallStack) ``` This has a few benefits: 1. No need to enable `ImplicitParams` in user code. 2. No need to remember the `?callStack` naming convention. 3. Gives us the option to change the implementation details in the future with less user-land breakage. The revised `CallStack` API is exported from `GHC.Stack` and makes no mention of the implicit parameter. Test Plan: ./validate Reviewers: simonpj, austin, hvr, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1818
* Add release note about flexible RebindableSyntaxRichard Eisenberg2016-01-291-0/+8
|
* Document -fllvm-fill-undef-with-garbageBen Gamari2016-01-271-0/+6
|
* Typos in commentsGabor Greif2016-01-271-1/+1
|
* Split off -Wunused-type-variables from -Wunused-matchesRyanGlScott2016-01-263-16/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, `-Wunused-matches` would fire whenever it detected unused type variables in a type family or data family instance. This can be annoying for users who wish to use type variable names as documentation, as being `-Wall`-compliant would mean that they'd have to prefix many of their type variable names with underscores, making the documentation harder to read. To avoid this, a new warning `-Wunused-type-variables` was created that only encompasses unused variables in family instances. `-Wunused-matches` reverts back to its role of only warning on unused term-level pattern names. Unlike `-Wunused-matches`, `-Wunused-type-variables` is not implied by `-Wall`. Fixes #11451. Test Plan: ./validate Reviewers: goldfire, ekmett, austin, hvr, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1825 GHC Trac Issues: #11451
* Minor users-guide markup fixup [skip ci]Herbert Valerio Riedel2016-01-261-2/+2
|
* Missed plural renaming in user's guideHerbert Valerio Riedel2016-01-261-1/+1
| | | | | | Follow-up to 132c20894d102558cc8f3aee5bc289425d0ddb24 [skip ci]
* Implement -Wunrecognised-warning-flagBen Gamari2016-01-251-0/+8
| | | | | | | | | | | | | | | | | This allows the user to avoid warnings for warning flags that GHC doesn't recognise. See #11429 for details.. Test Plan: Validate with T11429[abc] tests Reviewers: austin, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1830 GHC Trac Issues: #11429
* user-guide: Note order-dependence of flagsBen Gamari2016-01-251-0/+22
| | | | | | | | | | | | | | | This supplements the description previously added in 6400c7687223c5b2141176aa92f7ff987f61aba6. See #10560 for details. Test Plan: read it Reviewers: austin Subscribers: thomie, hvr Differential Revision: https://phabricator.haskell.org/D1831 GHC Trac Issues: #10560
* Better document behavior of -Wmissed-specialisationsBen Gamari2016-01-251-1/+2
| | | | | | | | | | Test Plan: Read it Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1829