| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Test cases: typecheck/should_fail/T1172{3,4}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
| |
[skip ci]
|
|
|
|
| |
[skip ci]
|
|
|
|
|
| |
This makes it a bit easier to find the description corresponding to
particular flags.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1991
GHC Trac Issues: #9887
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1987
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: read it
Reviewers: austin, goldfire
Reviewed By: goldfire
Subscribers: hvr, thomie
Differential Revision: https://phabricator.haskell.org/D1981
GHC Trac Issues: #11679
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
This fixes #9917.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1927
GHC Trac Issues: #11590
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bgamari, austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1915
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1899
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
George updated the Diff but I didn't noticed until it was too late.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Spelling mistakes fixed,
* identiy > identity
* suprising > surprising
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1871
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
Follow-up to 132c20894d102558cc8f3aee5bc289425d0ddb24
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Read it
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1829
|