summaryrefslogtreecommitdiff
path: root/compiler/parser/Parser.y.pp
Commit message (Collapse)AuthorAgeFilesLines
...
* Support "phase control" for SPECIALISE pragmasSimon Peyton Jones2011-11-241-5/+6
| | | | | | | | | | | | | This featurelet allows Trac #5237 to be fixed. The idea is to allow SPECIALISE pragmas to specify the phases in which the RULE is active, just as you can do with RULES themselves. {-# SPECIALISE [1] foo :: Int -> Int #-} This feature is so obvious that not having it is really a bug. There are, needless to say, a few wrinkles. See Note [Activation pragmas for SPECIALISE] in DsBinds
* Removing the default grouping clause from the SQL-like comprehension notation ;George Giorgidze2011-11-171-14/+8
|
* Changes to the kind checkerJose Pedro Magalhaes2011-11-161-2/+2
| | | | | | | | | | | | | We now always check against an expected kind. When we really don't know what kind to expect, we match against a new meta kind variable. Also, we are more explicit about tuple sorts: HsUnboxedTuple -> Produced by the parser HsBoxedTuple -> Certainly a boxed tuple HsConstraintTuple -> Certainly a constraint tuple HsBoxedOrConstraintTuple -> Could be a boxed or a constraint tuple. Produced by the parser only, disappears after type checking
* Restore file modeJose Pedro Magalhaes2011-11-111-0/+0
|
* New kind-polymorphic coreJose Pedro Magalhaes2011-11-111-30/+77
| | | | | | | | | This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds
* added NOUNPACK pragma (see #2338)Stefan Wehr2011-11-091-0/+2
|
* Overhaul of infrastructure for profiling, coverage (HPC) and breakpointsSimon Marlow2011-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User visible changes ==================== Profilng -------- Flags renamed (the old ones are still accepted for now): OLD NEW --------- ------------ -auto-all -fprof-auto -auto -fprof-exported -caf-all -fprof-cafs New flags: -fprof-auto Annotates all bindings (not just top-level ones) with SCCs -fprof-top Annotates just top-level bindings with SCCs -fprof-exported Annotates just exported bindings with SCCs -fprof-no-count-entries Do not maintain entry counts when profiling (can make profiled code go faster; useful with heap profiling where entry counts are not used) Cost-centre stacks have a new semantics, which should in most cases result in more useful and intuitive profiles. If you find this not to be the case, please let me know. This is the area where I have been experimenting most, and the current solution is probably not the final version, however it does address all the outstanding bugs and seems to be better than GHC 7.2. Stack traces ------------ +RTS -xc now gives more information. If the exception originates from a CAF (as is common, because GHC tends to lift exceptions out to the top-level), then the RTS walks up the stack and reports the stack in the enclosing update frame(s). Result: +RTS -xc is much more useful now - but you still have to compile for profiling to get it. I've played around a little with adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem quite accurately. I plan to add more facilities for stack tracing (e.g. in GHCi) in the future. Coverage (HPC) -------------- * derived instances are now coloured yellow if they weren't used * likewise record field names * entry counts are more accurate (hpc --fun-entry-count) * tab width is now correct (markup was previously off in source with tabs) Internal changes ================ In Core, the Note constructor has been replaced by Tick (Tickish b) (Expr b) which is used to represent all the kinds of source annotation we support: profiling SCCs, HPC ticks, and GHCi breakpoints. Depending on the properties of the Tickish, different transformations apply to Tick. See CoreUtils.mkTick for details. Tickets ======= This commit closes the following tickets, test cases to follow: - Close #2552: not a bug, but the behaviour is now more intuitive (test is T2552) - Close #680 (test is T680) - Close #1531 (test is result001) - Close #949 (test is T949) - Close #2466: test case has bitrotted (doesn't compile against current version of vector-space package)
* VECTORISE pragmas for type classes and instancesManuel M T Chakravarty2011-10-311-0/+5
| | | | * Frontend support (not yet used in the vectoriser)
* Tabs -> spacesManuel M T Chakravarty2011-10-311-924/+924
|
* Fully implement for VECTORISE type pragmas (non-SCALAR).Manuel M T Chakravarty2011-10-101-4/+9
|
* Tidy up the shape-checking for instance typesSimon Peyton Jones2011-09-291-4/+3
| | | | | | (in instance and standalone deriving decls) Fixes Trac #5513.
* Define a TraditionalRecordSyntax extension; fixes #3356Ian Lynagh2011-09-271-3/+4
| | | | | | This allows the extension (which is on by default) to be turned off, which gets us a small step closer to replacing Haskell98 records with something better.
* Merge branch 'no-pred-ty'Max Bolingbroke2011-09-091-12/+17
|\ | | | | | | | | | | | | | | | | | | Conflicts: compiler/iface/BuildTyCl.lhs compiler/iface/MkIface.lhs compiler/iface/TcIface.lhs compiler/typecheck/TcTyClsDecls.lhs compiler/types/Class.lhs compiler/utils/Util.lhs
| * Implement -XConstraintKindMax Bolingbroke2011-09-061-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact, this patch adds a new kind Constraint such that: Show :: * -> Constraint (?x::Int) :: Constraint (Int ~ a) :: Constraint And you can write *any* type with kind Constraint to the left of (=>): even if that type is a type synonym, type variable, indexed type or so on. The following (somewhat related) changes are also made: 1. We now box equality evidence. This is required because we want to give (Int ~ a) the *lifted* kind Constraint 2. For similar reasons, implicit parameters can now only be of a lifted kind. (?x::Int#) => ty is now ruled out 3. Implicit parameter constraints are now allowed in superclasses and instance contexts (this just falls out as OK with the new constraint solver) Internally the following major changes were made: 1. There is now no PredTy in the Type data type. Instead GHC checks the kind of a type to figure out if it is a predicate 2. There is now no AClass TyThing: we represent classes as TyThings just as a ATyCon (classes had TyCons anyway) 3. What used to be (~) is now pretty-printed as (~#). The box constructor EqBox :: (a ~# b) -> (a ~ b) 4. The type LCoercion is used internally in the constraint solver and type checker to represent coercions with free variables of type (a ~ b) rather than (a ~# b)
* | Revert "Get rid of associated-type default declarations"Max Bolingbroke2011-09-091-0/+6
|/ | | | This reverts commit 5e102e64d6e581e3ea1f290547fc4be6fce20a00.
* Get rid of associated-type default declarationsSimon Peyton Jones2011-09-011-6/+0
| | | | | | | | | | | | We had the idea that you might be able to define a default instance for an associated type family, thus: class C a where type T a :: * type T a = a -> a It's an idea that makes sense, but it was only 10% implemented. This patch just removes that misleading 10%.
* Add VECTORISE [SCALAR] type pragmaManuel M T Chakravarty2011-08-191-5/+9
| | | | | | | | | - Pragma to determine how a given type is vectorised - At this stage only the VECTORISE SCALAR variant is used by the vectoriser. - '{-# VECTORISE SCALAR type t #-}' implies that 't' cannot contain parallel arrays and may be used in vectorised code. However, its constructors can only be used in scalar code. We use this, e.g., for 'Int'. - May be used on imported types See also http://hackage.haskell.org/trac/ghc/wiki/DataParallel/VectPragma
* Refactor the imports of InteractiveContextSimon Peyton Jones2011-08-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of two fields ic_toplev_scope :: [Module] ic_imports :: [ImportDecl RdrName] we now just have one ic_imports :: [InteractiveImport] with the auxiliary data type data InteractiveImport = IIDecl (ImportDecl RdrName) -- Bring the exports of a particular module -- (filtered by an import decl) into scope | IIModule Module -- Bring into scope the entire top-level envt of -- of this module, including the things imported -- into it. This makes lots of code less confusing. No change in behaviour. It's preparatory to fixing Trac #5147. While I was at I also * Cleaned up the handling of the "implicit" Prelude import by adding a ideclImplicit field to ImportDecl. This significantly reduces plumbing in the handling of the implicit Prelude import * Used record notation consistently for ImportDecl
* White space onlySimon Peyton Jones2011-07-271-1/+1
|
* Remove 'threadsafe' FFI importsIan Lynagh2011-07-131-6/+2
| | | | They've been deprecated since GHC 6.12.
* Fix bug in parsing of module headers (see #5243)Simon Marlow2011-07-121-3/+7
|
* SafeHaskell: Add safe import flag (not functional)David Terei2011-06-171-2/+6
|
* Merge branch 'master' of http://darcs.haskell.org/ghcDavid Waern2011-06-131-34/+36
|\
| * Added a pragma {-# NOVECTORISE f #-} that suppresses vectorisation of ↵Manuel M T Chakravarty2011-06-131-34/+36
| | | | | | | | toplevel variable 'f'.
* | Merge branch 'master' of http://darcs.haskell.org/ghcDavid Waern2011-06-101-4/+2
|\ \ | |/
| * Refactor SrcLoc and SrcSpanIan Lynagh2011-06-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Unhelpful" cases are now in a separate type. This allows us to improve various things, e.g.: * Most of the panic's in SrcLoc are now gone * The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it knows that it has real locations and thus can assume that the line number etc really exists * Some of the more suspicious cases are no longer necessary, e.g. we no longer need this case in advanceSrcLoc: advanceSrcLoc loc _ = loc -- Better than nothing More improvements can probably be made, e.g. tick locations can probably use RealSrcSpans too.
* | Change TypeSig and GenericSig to take a list of names (fixes #1595).David Waern2011-06-101-1/+1
|/ | | | | This is a merge of a patch contributed by Michal Terepeta and the recent generics changes.
* Remove comment mentioning the old generic classes.Jose Pedro Magalhaes2011-05-051-2/+1
|
* Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-genericsJose Pedro Magalhaes2011-05-041-11/+9
|\ | | | | | | | | Fixed conflicts: compiler/prelude/PrelNames.lhs
| * More on monad-comp; an intermediate state, so don't pullSimon Peyton Jones2011-05-021-1/+1
| |
| * Simon's hacking on monad-comp; incompleteSimon Peyton Jones2011-04-291-12/+9
| |
| * Preliminary monad-comprehension patch (Trac #4370)Simon Peyton Jones2011-04-281-2/+3
| | | | | | | | | | | | | | | | This is the work of Nils Schweinsberg <mail@n-sch.de> It adds the language extension -XMonadComprehensions, which generalises list comprehension syntax [ e | x <- xs] to work over arbitrary monads.
* | Remove HsNumTy and TypePati.Jose Pedro Magalhaes2011-05-041-2/+0
| | | | | | | | They belonged to the old generic deriving mechanism, so they can go. Adapted a lot of code as a consequence.
* | Use 'default' rather than 'generic' for default-method signaturesSimon Peyton Jones2011-04-281-5/+7
| | | | | | | | | | | | Also get rid of the old {| |} brackets in the lexer. Fewer keywords!
* | Initial commit for Pedro's new generic default methodssimonpj2011-04-121-3/+8
|/ | | | | (See his Haskell Symposium 2010 paper "A generic deriving mechaism for Haskell")
* Added a VECTORISE pragmaManuel M T Chakravarty2011-02-201-0/+4
| | | | | | | | | | | | | | | - Added a pragma {-# VECTORISE var = exp #-} that prevents the vectoriser from vectorising the definition of 'var'. Instead it uses the binding '$v_var = exp' to vectorise 'var'. The vectoriser checks that the Core type of 'exp' matches the vectorised Core type of 'var'. (It would be quite complicated to perform that check in the type checker as the vectorisation of a type needs the state of the VM monad.) - Added parts of a related VECTORISE SCALAR pragma - Documented -ddump-vect - Added -ddump-vt-trace - Some clean up
* Tidy up rebindable syntax for MDosimonpj@microsoft.com2010-12-221-1/+3
| | | | | | | | | | | | | | | | | | | | For a long time an 'mdo' expression has had a SyntaxTable attached to it. However, we're busy deprecating SyntaxTables in favour of rebindable syntax attached to individual Stmts, and MDoExpr was totally inconsistent with DoExpr in this regard. This patch tidies it all up. Now there's no SyntaxTable on MDoExpr, and 'modo' is generally handled much more like 'do'. There is resulting small change in behaviour: now MonadFix is required only if you actually *use* recursion in mdo. This seems consistent with the implicit dependency analysis that is done for mdo. Still to do: * Deal with #4148 (this patch is on the way) * Get rid of the last remaining SyntaxTable on HsCmdTop
* Remove references to Haskell 98Ian Lynagh2010-11-231-4/+4
| | | | | They are no longer right, as we have Haskell' generating new Haskell standards.
* remove -XNoMonomorphismRestrictionSimon Marlow2010-11-171-9/+1
| | | | | This was apparently needed at some point during the new typechecker development, but does not seem to be required now.
* add some {-# LANGUAGE BangPatterns #-} to mollify GHCSimon Marlow2010-11-171-0/+1
|
* Warn about top-level bangs (Trac #4477)simonpj@microsoft.com2010-11-121-9/+14
| | | | A simple refactoring in the parser
* Add rebindable syntax for if-then-elsesimonpj@microsoft.com2010-10-221-1/+1
| | | | | | | | | | | There are two main changes * New LANGUAGE option RebindableSyntax, which implies NoImplicitPrelude * if-the-else becomes rebindable, with function name "ifThenElse" (but case expressions are unaffected) Thanks to Sam Anklesaria for doing most of the work here
* Interruptible FFI calls with pthread_kill and CancelSynchronousIO. v4Edward Z. Yang2010-09-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | This is patch that adds support for interruptible FFI calls in the form of a new foreign import keyword 'interruptible', which can be used instead of 'safe' or 'unsafe'. Interruptible FFI calls act like safe FFI calls, except that the worker thread they run on may be interrupted. Internally, it replaces BlockedOnCCall_NoUnblockEx with BlockedOnCCall_Interruptible, and changes the behavior of the RTS to not modify the TSO_ flags on the event of an FFI call from a thread that was interruptible. It also modifies the bytecode format for foreign call, adding an extra Word16 to indicate interruptibility. The semantics of interruption vary from platform to platform, but the intent is that any blocking system calls are aborted with an error code. This is most useful for making function calls to system library functions that support interrupting. There is no support for pre-Vista Windows. There is a partner testsuite patch which adds several tests for this functionality.
* Implement INLINABLE pragma simonpj@microsoft.com2010-09-151-11/+7
| | | | Implements Trac #4299. Documentation to come.
* Super-monster patch implementing the new typechecker -- at lastsimonpj@microsoft.com2010-09-131-2/+2
| | | | | | | | | This major patch implements the new OutsideIn constraint solving algorithm in the typecheker, following our JFP paper "Modular type inference with local assumptions". Done with major help from Dimitrios Vytiniotis and Brent Yorgey.
* Work around missing type signature in Happysimonpj@microsoft.com2010-07-301-1/+9
| | | | | | | | | | | | | Happy generates notHappyAtAll = error "Blah" without a type signature, and currently the new typechecker doesn't generalise it. This patch says "no monomorphism restriction" which makes it generalise again. Better would be to add a type sig to Happy's template
* Add DoAndIfThenElse supportIan Lynagh2010-08-081-1/+7
|
* Make datatype contexts an extension (on by default) (DatatypeContexts)Ian Lynagh2010-07-071-3/+3
|
* Fix Trac #3966: warn about useless UNPACK pragmassimonpj@microsoft.com2010-05-061-1/+1
| | | | | | | | | | | | Warning about useless UNPACK pragmas wasn't as easy as I thought. I did quite a bit of refactoring, which improved the code by refining the types somewhat. In particular notice that in DataCon, we have dcStrictMarks :: [HsBang] dcRepStrictness :: [StrictnessMarks] The former relates to the *source-code* annotation, the latter to GHC's representation choice.
* Minor refactoring of placeHolderPunRhssimonpj@microsoft.com2010-03-041-5/+4
|