| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This re-working of the typechecker algorithm is based on
the paper "Visible type application", by Richard Eisenberg,
Stephanie Weirich, and Hamidhasan Ahmed, to be published at
ESOP'16.
This patch introduces -XTypeApplications, which allows users
to say, for example `id @Int`, which has type `Int -> Int`. See
the changes to the user manual for details.
This patch addresses tickets #10619, #5296, #10589.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Given:
* `file = "foo.a.b"`
* `osuf = ".a.b"` -- Note the initial dot.
* `new_osuf = "c"`
Before (bad, the last character of the filename is dropped):
`dropTail (length osuf + 1) file <.> new_osuf == "fo.c"`
After (good):
`stripExtension osuf file <.> new_osuf` == "foo.c"
This regression was introduced in commit c489af73 (#5554). That commit
fixed a similar but different bug, and care has been taken to not
reintroduce it (using the the newly introduced
`System.Filepath.stripExtension`).
Given:
* `file = "foo.a.b"`
* `osuf = "a.b"`
* `new_osuf = "c"`
Before c489af73 (bad, the full suffix should get replaced):
`replaceExtension file new_osuf == "foo.a.c"`
After c489af73 (good):
`dropTail (length osuf + 1) file <.> new_osuf == "foo.c"`
After this commit (still good):
`stripExtension osuf file <.> new_osuf == "foo.c"`
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D1692
GHC Trac Issues: #9760
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: run tests on powerpc and x86_64
Reviewers: hvr, austin, thomie, bgamari
Reviewed By: thomie, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1694
|
|
|
|
|
| |
Python 3 support seems to have mildly bitrotten since #9184 was closed.
Luckily, only some minor tweaks seem necessary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: A regression test for #10432, which seems to already be fixed.
Test Plan: ./validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1691
GHC Trac Issues: #10432
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces "freezing," an operation which prevents further
locations from being appended to a CallStack. Library authors may want
to prevent CallStacks from exposing implementation details, as a matter
of hygiene. For example, in
```
head [] = error "head: empty list"
ghci> head []
*** Exception: head: empty list
CallStack (from implicit params):
error, called at ...
```
including the call-site of `error` in `head` is not strictly necessary
as the error message already specifies clearly where the error came
from.
So we add a function `freezeCallStack` that wraps an existing CallStack,
preventing further call-sites from being pushed onto it. In other words,
```
pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack
```
Now we can define `head` to not produce a CallStack at all
```
head [] =
let ?callStack = freezeCallStack emptyCallStack
in error "head: empty list"
ghci> head []
*** Exception: head: empty list
CallStack (from implicit params):
error, called at ...
```
---
1. We add the `freezeCallStack` and `emptyCallStack` and update the
definition of `CallStack` to support this functionality.
2. We add `errorWithoutStackTrace`, a variant of `error` that does not
produce a stack trace, using this feature. I think this is a sensible
wrapper function to provide in case users want it.
3. We replace uses of `error` in base with `errorWithoutStackTrace`. The
rationale is that base does not export any functions that use CallStacks
(except for `error` and `undefined`) so there's no way for the stack
traces (from Implicit CallStacks) to include user-defined functions.
They'll only contain the call to `error` itself. As base already has a
good habit of providing useful error messages that name the triggering
function, the stack trace really just adds noise to the error. (I don't
have a strong opinion on whether we should include this third commit,
but the change was very mechanical so I thought I'd include it anyway in
case there's interest)
4. Updates tests in `array` and `stm` submodules
Test Plan: ./validate, new test is T11049
Reviewers: simonpj, nomeata, goldfire, austin, hvr, bgamari
Reviewed By: simonpj
Subscribers: thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D1628
GHC Trac Issues: #11049
|
|
|
|
| |
This closes Trac #10897
|
|
|
|
| |
Fixes Trac #11278
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The *-ws-32 file were too difficult to keep up-to-date so @bgamari
updated the test outut normalization code in commit 786d528e8f949d
to make these files un-necessary.
Test Plan: test on PowerPC
Reviewers: hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie, bgamari
Differential Revision: https://phabricator.haskell.org/D1690
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added test and changed -Nmax to -maxN, -n was taken
Noticed strange -m behavoir and fixed -m from quietly
ignoring being passed invalid opts, e.g. "-msasd"
Reviewers: simonmar, hvr, austin, thomie, bgamari
Reviewed By: hvr, thomie, bgamari
Subscribers: bgamari, hvr, thomie, simonmar
Differential Revision: https://phabricator.haskell.org/D1677
GHC Trac Issues: #10728
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The main change is to add PatSynPE to PromotionErr, so that
when we get an ill-staged use of a pattern synonym we get a
civilised error message.
We were already doing this in half-baked form in tcValBinds, but
this patch tidies up the impl (which previously used a hack rather
than APromotionErr), and does it in tcTyClsInstDecls too.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I'm reverting this until we agree a design.
See comment:5 in Trac #9793.
Incidentally the reference to Trac #9739 in the reverted
patch is bogus; it shold have said #9793.
This reverts commit 44640af7afa1a01ff2e2357f7c1436b4804866fc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The basic idea is that we have a new set of "exposed modules"
which are /only/ used for plugins, i.e. -fplugin Foo and
--frontend Foo. You can interact with this namespace
using the flags -plugin-package-id and -plugin-package.
By default, this namespace contains all modules in the
user namespace (as before), but you can toggle that using
-hide-all-plugin-packages.
There is one nasty hack: GhcMake respects -fplugin in
GHC_OPTIONS to make local plugins work correctly. It also
bails out of you have an import of a module which doesn't
exist locally or in the package database. The upshot is
that we need to be sure to check in the plugin modules
too, so we don't give a spurious failure when a plugin
is in the plugin namespace but not the main namespace.
A better way to fix this would be to distinguish between
plugin and normal dependencies in ModSummary.
I cheated a little and tweaked a few existing plugins
tests to exercise the new code paths.
TODO: Documentation
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: bgamari, austin, simonpj, duncan
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1661
GHC Trac Issues: #11244
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Michal's work on #10982, #11098, refactored the handling of named
wildcards by making them more like ordinary type variables.
This patch takes the same idea to its logical conclusion, resulting
in a much tidier, tighter implementation.
Read Note [The wildcard story for types] in HsTypes.
Changes:
* Named wildcards are ordinary type variables, throughout
* HsType no longer has a data constructor for named wildcards
(was NamedWildCard in HsWildCardInfo). Named wildcards are
simply HsTyVars
* Similarly named wildcards disappear from Template Haskell
* I refactored RnTypes to avoid polluting LocalRdrEnv with something
as narrow as named wildcards. Instead the named wildcard set is
carried in RnTyKiEnv.
There is a submodule update for Haddock.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various tickets have revealed bad shortcomings in the typechecking of
pattern type synonyms. Discussed a lot in (the latter part of)
Trac #11224.
This patch fixes the most complex issues:
- Both parser and renamer now treat pattern synonyms as an
ordinary LHsSigType. Nothing special. Hooray.
- tcPatSynSig (now in TcPatSyn) typechecks the signature, and
decomposes it into its pieces.
See Note [Pattern synonym signatures]
- tcCheckPatSyn has had a lot of refactoring.
See Note [Checking against a pattern signature]
The result is a lot tidier and more comprehensible.
Plus, it actually works!
NB: this patch doesn't actually address the precise
target of #11224, namely "inlining pattern synonym
does not preserve semantics". That's an unrelated
bug, with a separate patch.
ToDo: better documentation in the user manual
Test Plan: Validate
Reviewers: austin, hvr, goldfire
Subscribers: goldfire, mpickering, thomie, simonpj
Differential Revision: https://phabricator.haskell.org/D1685
GHC Trac Issues: #11224
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, Template Haskell's treatment of strictness is not enough to
cover all possible combinations of unpackedness and strictness. In
addition, it isn't equipped to deal with new features (such as
`-XStrictData`) which can change a datatype's fields' strictness during
compilation.
To address this, I replaced TH's `Strict` datatype with
`SourceUnpackedness` and `SourceStrictness` (which give the programmer a
more complete toolkit to configure a datatype field's strictness than
just `IsStrict`, `IsLazy`, and `Unpack`). I also added the ability to
reify a constructor fields' strictness post-compilation through the
`reifyConStrictness` function.
Fixes #10697.
Test Plan: ./validate
Reviewers: simonpj, goldfire, bgamari, austin
Reviewed By: goldfire, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1603
GHC Trac Issues: #10697
|
|
|
|
|
| |
The addition of several new Semigroup instances caused
a Haddock allocation increase.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An HsAppInfix can carry a qconop/varop preceded by a SIMPLEQUOTE as a
Located RdrName.
In this case AnnSimpleQuote is attached to the Located HsAppType.
| SIMPLEQUOTE qconop {% ams (sLL $1 $> $ HsAppInfix $2)
[mj AnnSimpleQuote $1] }
| SIMPLEQUOTE varop {% ams (sLL $1 $> $ HsAppInfix $2)
[mj AnnSimpleQuote $1] }
This patch changes
data HsType name
...
| HsAppsTy [HsAppType name]
to
data HsType name
...
| HsAppsTy [LHsAppType name]
so that the annotation is not discarded when it reaches the ParsedSource
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: austin, bgamari, thomie
Reviewed By: bgamari, thomie
Differential Revision: https://phabricator.haskell.org/D1669
GHC Trac Issues: #11256
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now GADTs were supported in Template Haskell by encoding them using
normal data types. This patch adds proper support for representing GADTs
in TH.
Test Plan: T10828
Reviewers: goldfire, austin, bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D1465
GHC Trac Issues: #10828
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is still broken but really out to be fixed. At least know we'll
know if someone fixes it inadvertently.
Test Plan: validate
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1682
GHC Trac Issues: #8316
|
|
|
|
| |
See #11264 for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Breakpoints become SCCs, so we have detailed call-stack info for
interpreted code. Currently this only works when GHC is compiled with
-prof, but D1562 (Remote GHCi) removes this constraint so that in the
future call stacks will be available without building your own GHCi.
How can you get a stack trace?
* programmatically: GHC.Stack.currentCallStack
* I've added an experimental :where command that shows the stack when
stopped at a breakpoint
* `error` attaches a call stack automatically, although since calls to
`error` are often lifted out to the top level, this is less useful
than it might be (ImplicitParams still works though).
* Later we might attach call stacks to all exceptions
Other related changes in this diff:
* I reduced the number of places that get ticks attached for
breakpoints. In particular there was a breakpoint around the whole
declaration, which was often redundant because it bound no variables.
This reduces clutter in the stack traces and speeds up compilation.
* I tidied up some RealSrcSpan stuff in InteractiveUI, and made a few
other small cleanups
Test Plan: validate
Reviewers: ezyang, bgamari, austin, hvr
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1595
GHC Trac Issues: #11047
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This augments `MetaSel` with a `Bang` field, which gives generic
programmers access to the following information about each field
selector:
* `SourceUnpackedness`: whether a field was marked `{-# NOUNPACK #-}`,
`{-# UNPACK #-}`, or not
* `SourceStrictness`: whether a field was given a strictness (`!`) or
laziness (`~`) annotation
* `DecidedStrictness`: what strictness GHC infers for a field during
compilation, which may be influenced by optimization levels,
`-XStrictData`, `-funbox-strict-fields`, etc.
Unlike in Phab:D1603, generics does not grant a programmer the ability
to "splice" in metadata, so there is no issue including
`DecidedStrictness` with `Bang` (whereas in Template Haskell, it had to
be split off).
One consequence of this is that `MetaNoSel` had to be removed, since it
became redundant. The `NoSelector` empty data type was also removed for
similar reasons.
Fixes #10716.
Test Plan: ./validate
Reviewers: dreixel, goldfire, kosmikus, austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1646
GHC Trac Issues: #10716
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is derived from Haddock's `Operators` `html-test`, which appears to
fail with GHC master yet compiles with 7.10.2
Reviewers: simonpj, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1667
GHC Trac Issues: #11264
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The warnings are enabled with the flag -fwarn-unused-matches, the same
one that enables warnings on the term level.
Identifiers starting with an underscore are now always parsed as type
variables. When the NamedWildCards extension is enabled, the renamer
replaces those variables with named wildcards.
An additional NameSet nwcs is added to LocalRdrEnv. It's used to keep
names of the type variables that should be replaced with wildcards.
While renaming HsForAllTy, when a name is explicitly bound it is removed
from the nwcs NameSet. As a result, the renamer doesn't replace them in
the quantifier body. (Trac #11098)
Fixes #10982, #11098
Reviewers: alanz, bgamari, hvr, austin, jstolarek
Reviewed By: jstolarek
Subscribers: goldfire, mpickering, RyanGlScott, thomie
Differential Revision: https://phabricator.haskell.org/D1576
GHC Trac Issues: #10982
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new instance resolves to `s ~ [Char]` as soon as we know that `s ~
[a]`, to avoid certain functions (like (++)) causing a situation where
`a` is ambiguous and (currently) unable to be defaulted.
Reviewers: #core_libraries_committee, hvr, austin, bgamari
Reviewed By: hvr, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1572
GHC Trac Issues: #10814
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can allow them if they contain no free variables. This patch just allows
them in one direction and not to be used as builders as the original ticket
suggests.
Test Plan: ./validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1666
GHC Trac Issues: #9739
Conflicts:
testsuite/tests/patsyn/should_fail/all.T
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1665
GHC Trac Issues: #10426
|
|
|
|
|
|
|
|
| |
This is the new designated release to go with GHC 8.0.1
This is only a meta-data change relative to v0.5.7.0
/cc @foxik
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds two tests (one for Trac #4340 and one for Trac #10272), as well as
advice on how to fix your code if `hsc2hs` emits warnings with GHC 8.0
due to a redefinition of `#alignment`. (I also put the advice in the
[GHC 8.0 Migration
Guide](https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0).)
Reviewed By: thomie
Differential Revision: https://phabricator.haskell.org/D1663
GHC Trac Issues: #4340, #10272
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1655
GHC Trac Issues: #11122
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the pattern-match check we are looking for a proof of
*unsatisfiablity* among a bunch of givens. The unsat-ness might be
hidden in the superclasses, so we must expand them. But in the common
case where the constraints are satisfiable, we don't want to expand
a recursive superclass forever.
This is all a bit arbitrary, but then the whole question is
undecidable anyway.
The bug in Trac #10592 comment:12 was that I expanded superclasses
forever. This patch fixes it.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is the designated release to go with GHC 8.0.1
This release doesn't need any warning-suppression flags anymore, so
remove those from mk/warnings.mk
/cc @foxik
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These modules were previously provided by the `transformers`
package. Hence the submodule update.
This patch was originally contributed by M Farkas-Dyck and
subsequently taken over and completed by Ryan.
The original proposal discussion can be found at
https://mail.haskell.org/pipermail/libraries/2015-July/026014.html
This addresses #11135
Differential Revision: https://phabricator.haskell.org/D1543
|
|
|
|
| |
This should fix validate on Travis.
|
|
|
|
|
| |
And fix a redundant constraint warning in a test that requires
primitive.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't use the GNU make function 'realpath' (reverting e66a81c6),
because it doesn't handle spaces in paths. Instead, use 'cygpath' to
convert Windows style paths (e.g. C:/foo/) to mingw style paths (e.g.
c/foo/), and then call 'which'.
Tests:
* make TEST_HC=ghc
* make TEST_HC=/d/home/thomie/ghc-validate/bindisttest/install\ \ \ dir/bin/ghc
* make TEST_HC=D:/home/thomie/ghc-validate/bindisttest/install\ \ \ dir/bin/ghc
Reviewed by: Phyx
Differential Revision: https://phabricator.haskell.org/D1431
|
|
|
|
|
|
|
|
| |
Previously, we were optimizing away all case expressions over
coercions with dead binders. But sometimes we want to force
the coercion expression. Like when it contains an error.
Test case: typecheck/should_run/T11230
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, tcTyClTyVars required that the names of the LHsQTyVars
matched up exactly with the names of the kind of the given TyCon.
It now does a bit of matching up when necessary to relax this
restriction.
This commit enables a few tests that had previously been disabled.
The shortcoming this addresses is discussed in #11203, but that
ticket is not directly addressed here.
Test case: polykinds/SigTvKinds, perf/compiler/T9872d
|