| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
this is a remains from supporting Result Type Signaturs in the ancient
past.
Differential Revision: https://phabricator.haskell.org/D4066
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This switches the compiler/ component to get compiled with
-XNoImplicitPrelude and a `import GhcPrelude` is inserted in all
modules.
This is motivated by the upcoming "Prelude" re-export of
`Semigroup((<>))` which would cause lots of name clashes in every
modulewhich imports also `Outputable`
Reviewers: austin, goldfire, bgamari, alanz, simonmar
Reviewed By: bgamari
Subscribers: goldfire, rwbarton, thomie, mpickering, bgamari
Differential Revision: https://phabricator.haskell.org/D3989
|
|
|
|
|
|
|
|
| |
the worker/wrapper creates an artificial INLINE pragma, which caused CSE
to not do its work. We now recognize such artificial pragmas by using
`NoUserInline` instead of `Inline` as the `InlineSpec`.
Differential Revision: https://phabricator.haskell.org/D3939
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IOW, code compiles -Wnoncanonical-monoidfail-instances clean now
This is easy now since we require GHC 8.0/base-4.9 or later
for bootstrapping.
Note that we can easily enable `MonadFail` via
default-extensions: MonadFailDesugaring
in compiler/ghc.cabal.in
which currently would point out that NatM doesn't have
a proper `fail` method, even though failable patterns
are made use of:
compiler/nativeGen/SPARC/CodeGen.hs:425:25: error:
* No instance for (Control.Monad.Fail.MonadFail NatM)
arising from a do statement
with the failable pattern ‘(dyn_c, [dyn_r])’
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements @simonpj's suggested refactoring of the abstract syntax
for type/data family instances (from
https://ghc.haskell.org/trac/ghc/ticket/14131#comment:9). This combines
the previously separate `TyFamEqn` and `DataFamInstDecl` types into a
single `FamEqn` datatype. This also factors the `HsImplicitBndrs` out of
`HsTyPats` in favor of putting them just outside of `FamEqn` (as opposed
to before, where all of the implicit binders were embedded inside of
`TyFamEqn`/`DataFamInstDecl`). Finally, along the way I noticed that
`dfid_fvs` and `tfid_fvs` were completely unused, so I removed them.
Aside from some changes in parser test output, there is no change in
behavior.
Requires a Haddock submodule commit from my fork (at
https://github.com/RyanGlScott/haddock/commit/815d2deb9c0222c916becccf84
64b740c26255fd)
Test Plan: ./validate
Reviewers: simonpj, austin, goldfire, bgamari, alanz
Reviewed By: bgamari
Subscribers: mpickering, goldfire, rwbarton, thomie, simonpj
GHC Trac Issues: #14131
Differential Revision: https://phabricator.haskell.org/D3881
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC 8.2.1 is out, so now GHC's support window only extends back to GHC
8.0. This means we can delete gobs of code that was only used for GHC
7.10 support. Hooray!
Test Plan: ./validate
Reviewers: hvr, bgamari, austin, goldfire, simonmar
Reviewed By: bgamari
Subscribers: Phyx, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3781
|
|
|
|
|
|
|
| |
This is refactoring only... elimiante all positional uses
of the data constructor Match in favour of field names.
No change in behaviour.
|
|
|
|
|
| |
* Clarify the comments around the mc_strictness field of FunRhs
* Use record field names consistently for FunRhs
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
haddock-2.18 supports user defined pattern synonym signatures so this
seems like a welcomed addition.
Reviewers: austin, bgamari, mpickering
Reviewed By: bgamari, mpickering
Subscribers: rwbarton, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3699
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the missing branch for parsing the optional 'instance' keyword
in associated type family instance declarations.
Fixes #13747
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: simonpj, RyanGlScott, rwbarton, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3673
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is another attempt at resolving #13594 by treating strict variable
binds as FunBinds instead of PatBinds (as suggested in comment:1).
Test Plan: Validate
Reviewers: austin, alanz
Subscribers: rwbarton, thomie, mpickering
GHC Trac Issues: #13594
Differential Revision: https://phabricator.haskell.org/D3670
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow
This commit prepares the ground for a full extensible AST, by replacing the type
parameter for the hsSyn data types with a set of indices into type families,
data GhcPs -- ^ Index for GHC parser output
data GhcRn -- ^ Index for GHC renamer output
data GhcTc -- ^ Index for GHC typechecker output
These are now used instead of `RdrName`, `Name` and `Id`/`TcId`/`Var`
Where the original name type is required in a polymorphic context, this is
accessible via the IdP type family, defined as
type family IdP p
type instance IdP GhcPs = RdrName
type instance IdP GhcRn = Name
type instance IdP GhcTc = Id
These types are declared in the new 'hsSyn/HsExtension.hs' module.
To gain a better understanding of the extension mechanism, it has been applied
to `HsLit` only, also replacing the `SourceText` fields in them with extension
types.
To preserve extension generality, a type class is introduced to capture the
`SourceText` interface, which must be honoured by all of the extension points
which originally had a `SourceText`. The class is defined as
class HasSourceText a where
-- Provide setters to mimic existing constructors
noSourceText :: a
sourceText :: String -> a
setSourceText :: SourceText -> a
getSourceText :: a -> SourceText
And the constraint is captured in `SourceTextX`, which is a constraint type
listing all the extension points that make use of the class.
Updating Haddock submodule to match.
Test Plan: ./validate
Reviewers: simonpj, shayan-najd, goldfire, austin, bgamari
Subscribers: rwbarton, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3609
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: austin, bgamari, simonmar, mpickering
Reviewed By: mpickering
Subscribers: mpickering, rwbarton, thomie
GHC Trac Issues: #12610
Differential Revision: https://phabricator.haskell.org/D3584
|
|
|
|
|
|
|
|
| |
This partially reverts commit 372995364c52eef15066132d7d1ea8b6760034e6 as it
doesn't actually fix #13594. Namely it does not revert the mkPrefixFunRhs
refactoring since this is rather independent from the functional changes.
Going to try again with a whole working patch
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Lots of refactoring in RnEnv to reduce code duplication.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13545
Differential Revision: https://phabricator.haskell.org/D3507
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reworks the HsSyn representation to make banged variable patterns
(e.g. !x = e) be represented as FunBinds instead of PatBinds, adding a flag to
FunRhs to record the bang.
Fixes #13594.
Reviewers: austin, goldfire, alanz, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3525
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, mpickering
GHC Trac Issues: #13211
Differential Revision: https://phabricator.haskell.org/D3543
|
|
|
|
| |
Our new CPP linter enforces this.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #13454
Reviewers: austin, bgamari, dfeuer
Reviewed By: dfeuer
Subscribers: RyanGlScott, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3379
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes in a few different places to catch several different
types of error related to RecursiveDo
Signed-off-by: Rupert Horlick <ruperthorlick@gmail.com>
Test Plan: Three test cases, with further tests in comments
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3271
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This factors out a repeated pattern found in DynFlags, where we use an
IntSet and Enum to represent sets of flags.
Requires bump of haddock submodule.
Test Plan: validate
Reviewers: austin, goldfire
Subscribers: rwbarton, thomie, snowleopard
Differential Revision: https://phabricator.haskell.org/D3331
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: bgamari, austin
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3313
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Rupert Horlick <ruperthorlick@gmail.com>
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3286
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added a check for whether RankNTypes is enabled
and changed error message accordingly
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3262
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3261
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A top-level splice can be written
$splice
or
splice
For accurate pretty-printing, and for ghc-exactprint, capture in the hsSyn AST
which variant was parsed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parse `foo, bar, baz` into `And [foo, bar, baz]`
instead of `And [foo, And [bar, baz]]`.
Fixes #11024.
Test Plan: read and think
Reviewers: austin, bgamari, mpickering
Reviewed By: bgamari, mpickering
Subscribers: ezyang, thomie, alanz
Differential Revision: https://phabricator.haskell.org/D3139
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements automatic constraint solving for the new HasField class
and modifies the existing OverloadedLabels extension, as described in
the GHC proposal
(https://github.com/ghc-proposals/ghc-proposals/pull/6). Per the current
form of the proposal, it does *not* currently introduce a separate
`OverloadedRecordFields` extension.
This replaces D1687.
The users guide documentation still needs to be written, but I'll do
that after the implementation is merged, in case there are further
design changes.
Test Plan: new and modified tests in overloadedrecflds
Reviewers: simonpj, goldfire, dfeuer, bgamari, austin, hvr
Reviewed By: bgamari
Subscribers: maninalift, dfeuer, ysangkok, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2708
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[skip ci]
There ware some old file names (.lhs, ...) at comments.
* compiler/ghc.mk
- prelude/PrimOp.lhs -> prelude/PrimOp.hs
* compiler/parser/cutils.h
- PrimPacked.lhs -> compiler/utils/FastString.hs
Reviewers: bgamari, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3076
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
At the moment an export of the form
type C(..)
is parsed by the rule
```
| 'type' oqtycon {% amms (mkTypeImpExp (sLL $1 $> (unLoc $2)))
[mj AnnType $1,mj AnnVal $2] }
```
This means that the origiinal oqtycon loses its location which is then retained
in the AnnVal annotation.
The problem is if the oqtycon has its own annotations, these get lost.
e.g. in
type (?)(..)
the parens annotations for (?) get lost.
This patch adds a wrapper around the name in the IE type to
(a) provide a distinct location for the adornment annotation and
(b) identify the specific adornment, for use in the pretty printer rather than
occName magic.
Updates haddock submodule
Test Plan: ./validate
Reviewers: mpickering, dfeuer, bgamari, austin
Reviewed By: dfeuer
Subscribers: dfeuer, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3016
GHC Trac Issues: #13163
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a new pragma so that users can specify `COMPLETE` sets of
`ConLike`s in order to sate the pattern match checker.
A function which matches on all the patterns in a complete grouping
will not cause the exhaustiveness checker to emit warnings.
```
pattern P :: ()
pattern P = ()
{-# COMPLETE P #-}
foo P = ()
```
This example would previously have caused the checker to warn that
all cases were not matched even though matching on `P` is sufficient to
make `foo` covering. With the addition of the pragma, the compiler
will recognise that matching on `P` alone is enough and not emit
any warnings.
Reviewers: goldfire, gkaracha, alanz, austin, bgamari
Reviewed By: alanz
Subscribers: lelf, nomeata, gkaracha, thomie
Differential Revision: https://phabricator.haskell.org/D2669
GHC Trac Issues: #8779
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An unboxed tuple such as
(# | b | | | | | #)
Ends up in the parser via `tup_exprs` as
Sum 2 7 lexp
where `lexp` is a `LHsExpr`
From an API annotation perspective, the 5 `AnnVbar`s after the `b` were attached
to `lexp`, but the leading `AnnVbar`s did not have a home.
This patch attaches them all to the the parent tuple expression. The first (alt
- 1) of them come before `lexp`, and the remaining (arity - alt) come after.
Test Plan: ./validate
Reviewers: osa1, austin, bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2968
GHC Trac Issues: #12417
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Generally speaking, it's not possible to "hide" a requirement from a
package you include, because if there is some module relying on that
requirement, well, you can't just wish it out of existence.
However, some packages don't have any modules. For these, we can
validly thin out requirements; indeed, this is very convenient if
someone has published a large signature package but you only want
some of the definitions.
This patchset tweaks the interpretation of export lists in
signatures: in particular, they no longer need to refer to
entities that are defined locally; they range over both the current
signature as well as any signatures that were inherited from
signature packages (defined by having zero exposed modules.)
In the process of doing this, I cleaned up a number of other
things:
* rnModIface and rnModExports now report errors that occurred
during renaming and can propagate these to the TcM monad.
This is important because in the current semantics, you can
thin out a type which is referenced by a value you keep;
in this situation, we need to error (to ensure that all
types in signatures are rooted, so that we can determine
their identities).
* I ended up introducing a new construct 'dependency signature;
to bkp files, to make it easier to tell if we were depending
on a signature package. It's not difficult for Cabal to
figure this out (I already have a patch for it.)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2904
GHC Trac Issues: #12994
|
|
|
|
|
|
| |
To simplify API Annotations.
Updates haddock submodule
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported as #13050. Since holes are expressions but not identifiers,
holes were not allowed in infix operator position. This patch introduces
a new production in infix operator parser to allow this.
Reviewers: simonpj, austin, bgamari
Reviewed By: simonpj
Subscribers: simonpj, RyanGlScott, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2910
GHC Trac Issues: #13050
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we had the following parser:
xs : xs ';' x
| xs ';'
| x
This is a very clever construction that handles duplicate,
leading and trailing semicolons well, but it didn't work very
well with annotations, where we wanted to attach the annotation
for a semicolon to the *previous* x in the list. This lead
to some very disgusting code in the parser.
This commit refactors the parser into this form:
semis1 : semis1 ';'
| ';'
xs_semi : xs x semis1
| {- empty -}
xs : xs_semi x
Now, when we parse one or more semicolons after an x, we can
attach them immediately, eliminating some very grotty annotations
swizzling that was previously in the parser.
We now need to write the top-level parser for imports and then
declarations in a slightly special way now:
top : semis top1
top1 : importdecls_semi topdecls_semi
| importdecls_semi topdecls
| importdecls
This is because the *_semi parsers always require a semicolon,
but we're allowed to omit that last newline. So we need
special cases to handle each of the possible cases where we
may run out of semicolons. I don't know if there is a better
way to structure this, but it is not much more complicated
than what we had before for top (and asymptotically better!)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonmar, austin, alanz, bgamari
Reviewed By: alanz, bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2893
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Maybe everyone knows this but I think it is worth mentioning
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: none
Reviewers: bgamari, austin
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2890
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Based off my understanding of how the moving parts work.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: comments only
Reviewers: alanz, mpickering, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2887
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
At the moment, data and type declarations using infix formatting produce the
same AST as those using prefix.
So
type a ++ b = c
and
type (++) a b = c
cannot be distinguished in the parsed source, without looking at the OccName
details of the constructor being defined.
Having access to the OccName requires an additional constraint which explodes
out over the entire AST because of its recursive definitions.
In keeping with moving the parsed source to more directly reflect the source
code as parsed, add a specific flag to the declaration to indicate the fixity,
as used in a Match now too.
Note: this flag is to capture the fixity used for the lexical definition of the
type, primarily for use by ppr and ghc-exactprint.
Updates haddock submodule.
Test Plan: ./validate
Reviewers: mpickering, goldfire, bgamari, austin
Reviewed By: mpickering
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2828
GHC Trac Issues: #12942
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After talking to Richard, he and I concluded that choosing the rather
common name `Newtype` to represent the corresponding deriving strategy
in Template Haskell was a poor choice of name. I've opted to rename it
to something less common (`NewtypeStrategy`) while we still have time. I
also renamed the corrsponding datatype in the GHC internals so as to
match it.
Reviewers: austin, goldfire, hvr, bgamari
Reviewed By: bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2814
GHC Trac Issues: #10598
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add prettyprinter tests, which take a file, parse it, pretty print it,
re-parse the pretty printed version and then compare the original and
new ASTs (ignoring locations)
Updates haddock submodule to match the AST changes.
There are three issues outstanding
1. Extra parens around a context are not reproduced. This will require an
AST change and will be done in a separate patch.
2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
to prevent noise in the output.
I am not sure what the desired behaviour in this case is, so have left
it as before. Test Ppr047 is marked as expected fail for this.
3. Apart from in a context, the ParsedSource AST keeps all the parens from
the original source. Something is happening in the renamer to remove the
parens around visible type application, causing T12530 to fail, as the
dumped splice decl is after the renamer.
This needs to be fixed by keeping the parens, but I do not know where they
are being removed. I have amended the test to pass, by removing the parens
in the expected output.
Test Plan: ./validate
Reviewers: goldfire, mpickering, simonpj, bgamari, austin
Reviewed By: simonpj, bgamari
Subscribers: simonpj, goldfire, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2752
GHC Trac Issues: #3384
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This also changes the backpack Renaming type to use a Maybe for the
renameTo field, to more accurately reflect the parsed source.
Updates haddock submodule to match AST changes
Test Plan: ./validate
Reviewers: ezyang, bgamari, austin
Reviewed By: bgamari
Subscribers: thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2670
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Foreign imports with "prim" convention require a valid symbol identifier
(see linked issue). We check this.
Fix line too long
Test Plan: Validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2563
GHC Trac Issues: #12355
|