| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
The documentation for `Type`'s `ForallT` constructor had a typo (pun not
intended). `ctxt` is separated from `type` in the surface syntax by a fat
arrow (`=>`), not a thin arrow (`->`).
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This is follow-up to https://ghc.haskell.org/trac/ghc/ticket/10773
Reviewers: austin, goldfire, bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3816
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Correct a couple more spots in the TH pretty-printer by applying the
appropriate parenthesization for infix names. Fixes #13887 (again).
Test Plan: make test TEST=T13887
Reviewers: austin, bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13887
Differential Revision: https://phabricator.haskell.org/D3802
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Types and kinds are now the same in GHC... well, except in the code
that involves Template Haskell, where types and kinds are given separate
treatment. This aims to unify that treatment in the `DsMeta` module.
The gist of this patch is replacing all uses of `repLKind` with `repLTy`.
This is isn't quite as simple as one might imagine, since `repLTy` returns a
`Core (Q Type)` (a monadic expression), whereas `repLKind` returns a
`Core Kind` (a pure expression). This causes many awkward impedance mismatches.
One option would be to change every combinator in `Language.Haskell.TH.Lib` to
take `KindQ` as an argument instead of `Kind`. But this would be a breaking
change of colossal proportions.
Instead, this patch takes a somewhat different approach. This migrates the
existing `Language.Haskell.TH.Lib` module to
`Language.Haskell.TH.Lib.Internal`, and changes all `Kind`-related combinators
in `Language.Haskell.TH.Lib.Internal` to live in `Q`. The new
`Language.Haskell.TH.Lib` module then re-exports most of
`Language.Haskell.TH.Lib.Internal` with the exception of the `Kind`-related
combinators, for which it redefines them to be their current definitions (which
don't live in `Q`). This allows us to retain backwards compatibility with
previous `template-haskell` releases, but more importantly, it allows GHC to
make as many changes to the `Internal` code as it wants for its purposes
without fear of disrupting the public API.
This solves half of #11785 (the other half being `TcSplice`).
Test Plan: ./validate
Reviewers: goldfire, austin, bgamari
Reviewed By: goldfire
Subscribers: rwbarton, thomie
GHC Trac Issues: #11785
Differential Revision: https://phabricator.haskell.org/D3751
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: RyanGlScott, austin, goldfire, bgamari
Reviewed By: RyanGlScott, goldfire, bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3715
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously datatype names were not paraenthesized (#13887).
Reviewers: austin, bgamari, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3717
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: RyanGlScott, austin, goldfire, bgamari
Reviewed By: RyanGlScott, goldfire, bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3715
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using Template Haskell, one can construct lambda expressions with no
arguments. The pretty-printer isn't aware of this fact, however. This
changes that.
Test Plan: make test TEST=T13856
Reviewers: bgamari, austin, goldfire
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13856
Differential Revision: https://phabricator.haskell.org/D3664
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Bumps haddock submodule
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main goal is to easily allow the inline-c project (and
similar projects such as inline-java) to emit C/C++ files to
be compiled and linked with the current module.
Moreover, `addCStub` is removed, since it's quite fragile. Most
notably, the C stubs end up in the file generated by
`CodeOutput.outputForeignStubs`, which is tuned towards
generating a file for stubs coming from `capi` and Haskell-to-C
exports.
Reviewers: simonmar, austin, goldfire, facundominguez, dfeuer, bgamari
Reviewed By: dfeuer, bgamari
Subscribers: snowleopard, rwbarton, dfeuer, thomie, duncan, mboes
Differential Revision: https://phabricator.haskell.org/D3280
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
addCStub allows injecting C code in the current module to be included
in the final object file.
Test Plan: ./validate
Reviewers: simonpj, goldfire, austin, bgamari
Reviewed By: bgamari
Subscribers: bitonic, duncan, mboes, thomie
Differential Revision: https://phabricator.haskell.org/D3106
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: RyanGlScott, austin, goldfire, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2997
GHC Trac Issues: #13098
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: goldfire, bgamari, austin, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, simonpj, thomie, goldfire
Differential Revision: https://phabricator.haskell.org/D2546
GHC Trac Issues: #12511
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In D2448 (which introduced Template Haskell support for unboxed
sums), I neglected to add `unboxedSumDataName` and `unboxedSumTypeName`
functions, since there wasn't any way you could write unboxed sum data or type
constructors in prefix form to begin with (see #12514). But even if you can't
write these `Name`s directly in source code, it would still be nice to be able
to use these `Name`s in Template Haskell (for instance, to be able to treat
unboxed sum type constructors like any other type constructors).
Along the way, this uncovered a minor bug in `isBuiltInOcc_maybe` in
`TysWiredIn`, which was calculating the arity of unboxed sum data constructors
incorrectly.
Test Plan: make test TEST=T12478_5
Reviewers: osa1, goldfire, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2854
GHC Trac Issues: #12478, #12514
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reexporting `Language.Haskell.TH.Lib` from `Language.Haskell.TH` ensures
that `Language.Haskell.TH` will continue to expose all of the functions
that `Language.Haskell.TH.Lib` does in the future.
Fixes #12992.
Test Plan: ./validate
Reviewers: austin, bgamari, goldfire
Reviewed By: bgamari, goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2867
GHC Trac Issues: #12992
|
|
|
|
| |
Updates a number of submodules.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, these functions were hardcoded so as to always `error`
whenever given an argument of 0 or 1. This restriction can be lifted
pretty easily, however.
This requires a slight tweak to `isBuiltInOcc_maybe` in `TysWiredIn` to
allow it to recognize `Unit#` (which is the hard-wired `OccName` for
unboxed 1-tuples).
Fixes #12977.
Test Plan: make test TEST=12977
Reviewers: austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2847
GHC Trac Issues: #12977
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows users to explicitly request which approach to `deriving` to use
via keywords, e.g.,
```
newtype Foo = Foo Bar
deriving Eq
deriving stock Ord
deriving newtype Show
```
Fixes #10598. Updates haddock submodule.
Test Plan: ./validate
Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin,
erikd, simonmar
Reviewed By: alanz, bgamari, simonpj
Subscribers: thomie, mpickering, oerjan
Differential Revision: https://phabricator.haskell.org/D2280
GHC Trac Issues: #10598
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents the possibility of race conditions when creating fresh
names.
Test Plan: validate
Reviewers: goldfire, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2548
|
|
|
|
| |
See Note [Data for non-algebraic types]
|
|
|
|
|
|
|
|
| |
A folow-up to D2521 (which addressed #12583), where the `Outputable` `ppr`
output was tweaked to display a list comprehension with only one `Stmt` as
`[Foo]` instead of `[Foo|]` (which isn't valid Haskell). I forgot to update
the corresponding code in `Language.Haskell.TH.Ppr` which pretty-prints
`CompE`, however, so this commit takes care of that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
startsVarSym used isSymbol which does not recognize valid operators
beginning with OtherPunctuation generalCategory (e. g. (·)).
Move it to ghc-boot-th for reducing duplication.
This patch fixes template-haskell pretty printer, which is used by
-ddump-minimal-imports.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2480
GHC Trac Issues: #4239
|
|
|
|
|
| |
This reverts commit 8d35e18d885e60f998a9dddb6db19762fe4c6d92.
arc butchered the authorship on this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
startsVarSym used isSymbol which does not recognize valid operators
beginning with OtherPunctuation generalCategory (e. g. (·)).
Move it to ghc-boot-th for reducing duplication.
This patch fixes template-haskell pretty printer, which is used by
-ddump-minimal-imports.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2480
GHC Trac Issues: #4239
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current haddocks do not specify the scope of the state manipulated
by `getQ`/`putQ`.
Reviewers: austin, goldfire, bgamari, ezyang
Reviewed By: ezyang
Subscribers: ezyang, thomie
Differential Revision: https://phabricator.haskell.org/D2497
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes #12530.
Test Plan: make test TEST=12530
Reviewers: austin, bgamari, hvr, goldfire
Reviewed By: goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2472
GHC Trac Issues: #12530
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds new constructors `UnboxedSumE`, `UnboxedSumT`, and
`UnboxedSumP` to represent unboxed sums in Template Haskell.
One thing you can't currently do is, e.g., `reify ''(#||#)`, since I
don't believe unboxed sum type/data constructors can be written in
prefix form. I will look at fixing that as part of #12514.
Fixes #12478.
Test Plan: make test TEST=T12478_{1,2,3}
Reviewers: osa1, goldfire, austin, bgamari
Reviewed By: goldfire, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2448
GHC Trac Issues: #12478
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This annotates the splice point with 'HsSpliced ref e' where 'e' is the
result of the splice. 'ref' is a reference that the typechecker will fill with
the local type environment.
The finalizer then reads the ref and uses the local type environment, which
causes 'reify' to find local variables when run in the finalizer.
Test Plan: ./validate
Reviewers: simonpj, simonmar, bgamari, austin, goldfire
Reviewed By: goldfire
Subscribers: simonmar, thomie, mboes
Differential Revision: https://phabricator.haskell.org/D2286
GHC Trac Issues: #11832
|
| |
|
|
|
|
|
|
|
| |
* Replaced 2.11's *TBA* with *May 2016*
* Removed an outdated TODO comment
* Removed lines which incorrectly stated that some strictness-related
functions had been removed (they have been deprecated instead)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Deriving `Typeable` has been a no-op since GHC 7.10, and now that we
require 7.10+ to build GHC, we can remove all the redundant `deriving Typeable`
statements in GHC.
Test Plan: ./validate
Reviewers: goldfire, austin, hvr, bgamari
Reviewed By: austin, hvr, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2260
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This creates a new package, `ghc-boot-th`, to contain the `Extension`
type, which now lives in `GHC.LanguageExtension.Type`. This ensures that
the transitive dependency set of the `template-haskell` package remains
minimal.
The `GHC.LanguageExtensions.Type` module is also re-exported by
`ghc-boot`, which provides an orphan `binary` instance as well.
Test Plan: Validate
Reviewers: goldfire, thomie, hvr, austin
Reviewed By: thomie
Subscribers: RyanGlScott, thomie, erikd, ezyang
Differential Revision: https://phabricator.haskell.org/D2224
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds Template Haskell support for pattern synonyms as
requested by trac ticket #8761.
Test Plan: ./validate
Reviewers: thomie, jstolarek, osa1, RyanGlScott, mpickering, austin,
goldfire, bgamari
Reviewed By: goldfire, bgamari
Subscribers: rdragon
Differential Revision: https://phabricator.haskell.org/D1940
GHC Trac Issues: #8761
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: hvr, goldfire, austin, RyanGlScott, bgamari
Reviewed By: RyanGlScott, bgamari
Subscribers: RyanGlScott, thomie
Differential Revision: https://phabricator.haskell.org/D2118
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When `MonadFail`is available, this patch makes `MonadFail` a superclass
of `Quasi`, and `Q` an instance of `MonadFail`.
NB: Since f16ddcee0c64a92ab911a7841a8cf64e3ac671fd, we need to be able
to compile `template-haskell` with stage0 compilers that don't provide
a `MonadFail` class yet. Once we reach GHC 8.3 development we can drop
the CPP conditionals again.
Addresses #11661
Reviewed By: bgamari, goldfire
Differential Revision: https://phabricator.haskell.org/D1982
|
|
|
|
|
| |
GHC 8.1's template-haskell package requires base>=4.8 anyway, so
we can assume Numeric.Natural to be available unconditionally.
|
|
|
|
|
|
|
|
| |
As per #6032, `Rank2Types` and `PolymorphicComponents` have been
deprecated in favour of `RankNTypes`.
also update `other-extensions` in template-haskell.cabal flag to
reflect reality.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A small cosmetic change, but we have to do a bit of work to
actually support it:
- Cabal submodule update, so that Cabal passes us
-this-unit-id when we ask for it. This includes
a Cabal renaming to be consistent with Unit ID, which
makes ghc-pkg a bit more scrutable.
- Build system is updated to use -this-unit-id rather than
-this-package-key, to avoid deprecation warnings. Needs
a version test so I resurrected the old test we had
(sorry rwbarton!)
- I've *undeprecated* -package-name, so that we are in the same
state as GHC 7.10, since the "correct" flag will have only
entered circulation in GHC 8.0.
- I removed -package-key. Since we didn't deprecate -package-id
I think this should not cause any problems for users; they
can just change their code to use -package-id.
- The package database is indexed by UNIT IDs, not component IDs.
I updated the naming here.
- I dropped the signatures field from ExposedModule; nothing
was using it, and instantiatedWith from the package database
field.
- ghc-pkg was updated to use unit ID nomenclature, I removed
the -package-key flags but I decided not to add any new flags
for now.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: 23Skidoo, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D1780
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These 3 functions are useful to keep around a bit longer, to prevent
breaking existing code that uses them.
Related to #10697.
Reviewers: austin, goldfire, RyanGlScott, bgamari
Reviewed By: RyanGlScott, bgamari
Differential Revision: https://phabricator.haskell.org/D1761
|