summaryrefslogtreecommitdiff
path: root/compiler/rename/RnSource.hs
Commit message (Collapse)AuthorAgeFilesLines
...
* Injective type familiesJan Stolarek2015-09-031-15/+149
| | | | | | | | | | | | | | | | | | | For details see #6018, Phab:D202 and the wiki page: https://ghc.haskell.org/trac/ghc/wiki/InjectiveTypeFamilies This patch also wires-in Maybe data type and updates haddock submodule. Test Plan: ./validate Reviewers: simonpj, goldfire, austin, bgamari Subscribers: mpickering, bgamari, alanz, thomie, goldfire, simonmar, carter Differential Revision: https://phabricator.haskell.org/D202 GHC Trac Issues: #6018
* Expand declaration QQs first (#10047)Michael Smith2015-09-021-1/+8
| | | | | | | | | | | | | | | | | | | | | Declaration QuasiQuoters do not cause a group split like $(...) splices, and are run and expanded before other declarations in the group. Resolves the lingering issue with #10047, and fixes broken tests qq007 and qq008. Test Plan: validate Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: goldfire, simonpj, thomie, spinda Differential Revision: https://phabricator.haskell.org/D1199 GHC Trac Issues: #10047
* Support wild cards in data/type family instancesThomas Winant2015-08-031-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle anonymous wild cards in type or data family instance declarations like unnamed type variables. For instance (pun intented): type family F (a :: *) (b :: *) :: * type instance F Int _ = Int Is now the same as: type family F (a :: *) (b :: *) :: * type instance F Int x = Int Note that unlike wild cards in partial type signatures, no errors (or warnings with -XPartialTypeSignatures) are generated for these wild cards, as there is nothing interesting to report to the user, i.e. the inferred kind. Only anonymous wild cards are supported here, named and extra-constraints wild card are not. Test Plan: pass new tests Reviewers: goldfire, austin, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1092 GHC Trac Issues: #3699, #10586
* Better treatment of signatures in cls/instSimon Peyton Jones2015-07-301-53/+26
| | | | | | | | | The provoking cause for this patch is Trac #5001, comment:23. There was an INLINE pragma in an instance decl, that shouldn't be there. But there was no complaint, just a mysterious WARN later. I ended up having to do some real refactoring but the result is, I think, simpler and more robust.
* Refactor self-boot infoSimon Peyton Jones2015-07-211-27/+35
| | | | | | | | | | | | | | | | This patch is a simple refactoring that prepares for a later one, related to Trac #10083. * Add a field tcg_self_boot :: SelfBootInfo to TcGblEnv, where SelfBootInfo is a new data type, describing the hi-boot file, if any, for the module being compiled. * Make tcHiBootIface return SelfBootInfo, a new data type * Make other functions get SelfBootInfo from the monad. * Remove tcg_mod_name from TcGblEnv; it was barely used and simpler to pass around explicitly.
* Treat pattern-synonym binders more consistentlySimon Peyton Jones2015-06-021-19/+21
| | | | | | | | | | | Pattern-synonyms are in value declarations, but were being bound by getLocalNonValBinders. This seemed odd, and indeed staightening it out allowed me to remove a field from TopSigCtxt. The main changes are in RnSource.rnSrcDecls. Nice.
* ApiAnnotations : strings in warnings do not return SourceTextAlan Zimmerman2015-06-011-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. This patch now deals with all remaining instances of getSTRING to bring in a SourceText for each. This updates the haddock submodule as well, for the AST change. Test Plan: ./validate Reviewers: hvr, austin, goldfire Reviewed By: austin Subscribers: bgamari, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D907 GHC Trac Issues: #10313
* Permit empty closed type familiesAdam Gundry2015-05-041-2/+4
| | | | | | | | | | | | | | | | | | | Fixes #9840 and #10306, and includes an alternative resolution to #8028. This permits empty closed type families, and documents them in the user guide. It updates the Haddock submodule to support the API change. Test Plan: Added `indexed-types/should_compile/T9840` and updated `indexed-types/should_fail/ClosedFam4` and `th/T8028`. Reviewers: austin, simonpj, goldfire Reviewed By: goldfire Subscribers: bgamari, jstolarek, thomie, goldfire Differential Revision: https://phabricator.haskell.org/D841 GHC Trac Issues: #9840, #10306
* Typo fixes (mostly in comments)Gabor Greif2015-04-301-1/+1
|
* Rename role annotations w.r.t only local decls.Richard Eisenberg2015-04-241-7/+12
| | | | Fix #10263.
* Refactor the extra-deps stuff for hs-bootSimon Peyton Jones2015-03-171-26/+39
| | | | | | See Note [Extra dependencies from .hs-boot files] in RnSource No change in behaviour
* Refactor the handling of quasi-quotesSimon Peyton Jones2015-02-101-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Trac #10047 points out, a quasi-quotation [n|...blah...|] is supposed to behave exactly like $(n "...blah..."). But it doesn't! This was outright wrong: quasiquotes were being run even inside brackets. Now that TH supports both typed and untyped splices, a quasi-quote is properly regarded as a particular syntax for an untyped splice. But apart from that they should be treated the same. So this patch refactors the handling of quasiquotes to do just that. The changes touch quite a lot of files, but mostly in a routine way. The biggest changes by far are in RnSplice, and more minor changes in TcSplice. These are the places where there was real work to be done. Everything else is routine knock-on changes. * No more QuasiQuote forms in declarations, expressions, types, etc. So we get rid of these data constructors * HsBinds.QuasiQuoteD * HsExpr.HsSpliceE * HsPat.QuasiQuotePat * HsType.HsQuasiQuoteTy * We get rid of the HsQuasiQuote type altogether * Instead, we augment the HsExpr.HsSplice type to have three consructors, for the three types of splice: * HsTypedSplice * HsUntypedSplice * HsQuasiQuote There are some related changes in the data types in HsExpr near HsSplice. Specifically: PendingRnSplice, PendingTcSplice, UntypedSpliceFlavour. * In Hooks, we combine rnQuasiQuoteHook and rnRnSpliceHook into one. A smaller, clearer interface. * We have to update the Haddock submodule, to accommodate the hsSyn changes
* API Annotations tweaks.Alan Zimmerman2015-01-161-36/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: HsTyLit now has SourceText Update documentation of HsSyn to reflect which annotations are attached to which element. Ensure that the parser always keeps HsSCC and HsTickPragma values, to be ignored in the desugar phase if not needed Bringing in SourceText for pragmas Add Location in NPlusKPat Add Location in FunDep Make RecCon payload Located Explicitly add AnnVal to RdrName where it is compound Add Location in IPBind Add Location to name in IEThingAbs Add Maybe (Located id,Bool) to Match to track fun_id,infix This includes converting Match into a record and adding a note about why the fun_id needs to be replicated in the Match. Add Location in KindedTyVar Sort out semi-colons for parsing - import statements - stmts - decls - decls_cls - decls_inst This updates the haddock submodule. Test Plan: ./validate Reviewers: hvr, austin, goldfire, simonpj Reviewed By: simonpj Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D538
* Pattern synonym names need to be in scope before renaming bindings (#9889)Dr. ERDI Gergo2015-01-091-8/+18
| | | | I did a bit of refactoring at the same time, needless to say
* Spelling error in commentSimon Peyton Jones2015-01-081-1/+1
|
* Add a small commentSimon Peyton Jones2014-12-231-1/+1
|
* compiler: de-lhs rename/Austin Seipp2014-12-031-0/+1555
Signed-off-by: Austin Seipp <austin@well-typed.com>