summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace only in hsSyn/HsExpr.lhsIan Lynagh2012-10-211-105/+98
|
* Improve pretty-printing for holesSimon Peyton Jones2012-10-041-0/+2
|
* This big patch re-factors the way in which arrow-syntax is handledSimon Peyton Jones2012-10-035-216/+345
| | | | | | | | | | | | | | | | | | | | | | All the work was done by Dan Winograd-Cort. The main thing is that arrow comamnds now have their own data type HsCmd (defined in HsExpr). Previously it was punned with the HsExpr type, which was jolly confusing, and made it hard to do anything arrow-specific. To make this work, we now parameterise * MatchGroup * Match * GRHSs, GRHS * StmtLR and friends over the "body", that is the kind of thing they enclose. This "body" parameter can be instantiated to either LHsExpr or LHsCmd respectively. Everything else is really a knock-on effect; there should be no change (yet!) in behaviour. But it should be a sounder basis for fixing bugs.
* Add type "holes", enabled by -XTypeHoles, Trac #5910Simon Peyton Jones2012-09-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This single commit combines a lot of work done by Thijs Alkemade <thijsalkemade@gmail.com>, plus a slew of subsequent refactoring by Simon PJ. The basic idea is * Add a new expression form "_", a hole, standing for a not-yet-written expression * Give a useful error message that (a) gives the type of the hole (b) gives the types of some enclosing value bindings that mention the hole Driven by this goal I did a LOT of refactoring in TcErrors, which in turn allows us to report enclosing value bindings for other errors, not just holes. (Thijs rightly did not attempt this!) The major data type change is a new form of constraint data Ct = ... | CHoleCan { cc_ev :: CtEvidence, cc_hole_ty :: TcTauType, cc_depth :: SubGoalDepth } I'm still in two minds about whether this is the best plan. Another possibility would be to have a predicate type for holes, somthing like class Hole a where holeValue :: a It works the way it is, but there are some annoying special cases for CHoleCan (just grep for "CHoleCan").
* Fix pretty-printing for GADTs in infix formSimon Peyton Jones2012-08-281-2/+3
|
* TH: Pragmas refactoring.Mikhail Vorozhtsov2012-08-151-31/+61
| | | | Also adds RULES and 'SPECIALIZE instance' support.
* Convert prefix uses of (<>) to infix <>Ian Lynagh2012-08-051-1/+1
|
* Whitespace only in hsSyn/HsSyn.lhsIan Lynagh2012-08-051-42/+35
|
* De-orphan the Outputable Char instanceIan Lynagh2012-08-051-4/+0
|
* Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghcIan Lynagh2012-07-193-3/+31
|\
| * Improve pretty printing for 'rec' Stmts, using pprDeeperSimon Peyton Jones2012-07-161-2/+2
| | | | | | | | Fixes Trac #7074
| * Merge branch 'master' of darcs.haskell.org:/home/darcs/ghcSimon Peyton Jones2012-07-162-0/+28
| |\
| | * Implemented MultiWayIf extension.Mikhail Vorozhtsov2012-07-162-0/+16
| | |
| | * Implemented \case expressions.Mikhail Vorozhtsov2012-07-162-0/+12
| | |
| * | Spelling in commentSimon Peyton Jones2012-07-121-1/+1
| |/
* | Move -fno-warn-orphan flag into individual modulesIan Lynagh2012-07-151-0/+1
| |
* | HsStringPrim now contains FastBytes, not FastStringIan Lynagh2012-07-142-3/+3
|/
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-07-101-3/+3
|\ | | | | | | | | Conflicts: compiler/typecheck/TcRnDriver.lhs
| * Change more uses of sortLe to sortByIan Lynagh2012-06-221-3/+3
| |
* | Comments and pretty printingSimon Peyton Jones2012-07-102-3/+13
|/
* Template Haskell: StringPrimL now takes [Word8]Reiner Pope2012-06-191-1/+1
|
* Simplify the implementation of Implicit ParametersSimon Peyton Jones2012-06-133-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch re-implements implicit parameters via a class with a functional dependency: class IP (n::Symbol) a | n -> a where ip :: a This definition is in the library module GHC.IP. Notice how it use a type-literal, so we can have constraints like IP "x" Int Now all the functional dependency machinery works right to make implicit parameters behave as they should. Much special-case processing for implicit parameters can be removed entirely. One particularly nice thing is not having a dedicated "original-name cache" for implicit parameters (the nsNames field of NameCache). But many other cases disappear: * BasicTypes.IPName * IPTyCon constructor in Tycon.TyCon * CIPCan constructor in TcRnTypes.Ct * IPPred constructor in Types.PredTree Implicit parameters remain special in a few ways: * Special syntax. Eg the constraint (IP "x" Int) is parsed and printed as (?x::Int). And we still have local bindings for implicit parameters, and occurrences thereof. * A implicit-parameter binding (let ?x = True in e) amounts to a local instance declaration, which we have not had before. It just generates an implication contraint (easy), but when going under it we must purge any existing bindings for ?x in the inert set. See Note [Shadowing of Implicit Parameters] in TcSimplify * TcMType.sizePred classifies implicit parameter constraints as size-0, as before the change There are accompanying patches to libraries 'base' and 'haddock' All the work was done by Iavor Diatchki
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-06-071-1/+1
|\
| * Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghcIan Lynagh2012-06-052-11/+9
| |\
| * | Change how macros like ASSERT are definedIan Lynagh2012-06-051-1/+1
| | | | | | | | | | | | | | | By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we don't need to kludge things to keep the warning checker happy etc.
* | | Comments onlySimon Peyton Jones2012-06-071-2/+4
| |/ |/|
* | Pretty-printing improvementsSimon Peyton Jones2012-06-051-10/+7
| |
* | Use a *constructor* name when promoting a typeSimon Peyton Jones2012-06-051-1/+2
|/ | | | | This is when converting from TH -> HsSyn Thanks to Richard Eisenberg
* hsSyn/HsTypes.lhs is already tab-free, so remove the warning kludgeIan Lynagh2012-05-291-7/+0
|
* Fix scoping of kind variables in instance declarationsSimon Peyton Jones2012-05-221-10/+19
| | | | Fixes Trac #6118
* Wibbles to lunaris's patch for promoted kindsSimon Peyton Jones2012-05-181-3/+6
|
* Allow INLINABLE pragmas in THSimon Peyton Jones2012-05-181-5/+6
| | | | Thanks to mikhail.vorozhtsov for doing the work
* Applied lunaris's patch to allow promoted types and rich kinds in Template ↵Richard Eisenberg2012-05-181-74/+105
| | | | Haskell
* Refactor LHsTyVarBndrs to fix Trac #6081Simon Peyton Jones2012-05-115-92/+97
| | | | | | | | | | | | | | | This is really a small change, but it touches a lot of files quite significantly. The real goal is to put the implicitly-bound kind variables of a data/class decl in the right place, namely on the LHsTyVarBndrs type, which now looks like data LHsTyVarBndrs name = HsQTvs { hsq_kvs :: [Name] , hsq_tvs :: [LHsTyVarBndr name] } This little change made the type checker neater in a number of ways, but it was fiddly to push through the changes.
* Wibble to pretty printingSimon Peyton Jones2012-05-011-3/+1
|
* Tidy up a remaining glitch in unificationSimon Peyton Jones2012-05-013-19/+30
| | | | | | | | | | | | | | | | | | There was one place, in type checking parallel list comprehensions where we were unifying types, but had no convenient way to use the resulting coercion; instead we just checked that it was Refl. This was Wrong Wrong; it might fail unpredicably in a GADT-like situation, and it led to extra error-generation code used only in this one place. This patch tidies it all up, by moving the 'return' method from the *comprehension* to the ParStmtBlock. The latter is a new data type, now used for each sub-chunk of a parallel list comprehension. Because of the data type change, quite a few modules are touched, but only in a fairly trivial way. The real changes are in TcMatches (and corresponding desugaring); plus deleting code from TcUnify. This patch also fixes the pretty-printing bug in Trac #6060
* Move free-var info from InstDecl to FamInstDeclSimon Peyton Jones2012-04-202-21/+23
|
* Do SCC on instance declarations (fixes Trac #5715)Simon Peyton Jones2012-04-204-22/+25
| | | | | | | | | | | | | | | | | | The trouble here is that given {-# LANGUAGE DataKinds, TypeFamilies #-} data instance Foo a = Bar (Bar a) we want to get a sensible message that we can't use the promoted 'Bar' constructor until after its definition; it's a staging error. Bud the staging mechanism that we use for vanilla data declarations don't work here. Solution is to perform strongly-connected component analysis on the instance declarations. But that in turn means that we need to track free-variable information on more HsSyn declarations, which is why so many files are touched. All the changes are boiler-platey except the ones in TcInstDcls.
* Merge branch 'master' of http://darcs.haskell.org//ghcSimon Peyton Jones2012-04-131-91/+91
|\
| * Untabify HsTypesSimon Peyton Jones2012-04-131-91/+91
| |
| * Revert "Added ':runmonad' command to GHCi"Simon Peyton Jones2012-04-131-91/+100
| | | | | | | | | | | | | | | | | | | | Two problems, for now at any rate a) Breaks the build with lots of errors like No instance for (Show (IO ())) arising from a use of `print' b) Discussion of the approache hasn't converged yet (Simon M had a number of suggestions) This reverts commit eecd7c98c1f079c14d99ed831dff33a48ee45e67.
| * Added ':runmonad' command to GHCiDavid Terei2012-04-121-100/+91
| | | | | | | | | | | | | | | | | | This command allows you to lift user stmts in GHCi into an IO monad that implements the GHC.GHCi.GHCiSandboxIO type class. This allows for easy sandboxing of GHCi using :runmonad and Safe Haskell. Longer term it would be nice to allow a more general model for the Monad than GHCiSandboxIO but delaying this for the moment.
* | Allow kind-variable binders in type signaturesSimon Peyton Jones2012-04-132-35/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the last major addition to the kind-polymorphism story, by allowing (Trac #5938) type family F a -- F :: forall k. k -> * data T a -- T :: forall k. k -> * type instance F (T (a :: Maybe k)) = Char The new thing is the explicit 'k' in the type signature on 'a', which itself is inside a type pattern for F. Main changes are: * HsTypes.HsBSig now has a *pair* (kvs, tvs) of binders, the kind variables and the type variables * extractHsTyRdrTyVars returns a pair (kvs, tvs) and the function itself has moved from RdrHsSyn to RnTypes * Quite a bit of fiddling with TcHsType.tcHsPatSigType and tcPatSig which have become a bit simpler. I'm still not satisfied though. There's some consequential fiddling in TcRules too. * Removed the unused HsUtils.collectSigTysFromPats There's a consequential wibble to Haddock too
* Fixed typo in b857c8ad which caused NewtypeD to be interpreted as DataD.Mikhail Vorozhtsov2012-04-021-1/+1
| | | | Signed-off-by: Paolo Capriotti <p.capriotti@gmail.com>
* Merge branch 'master' of http://darcs.haskell.org//ghcSimon Peyton Jones2012-03-265-9/+36
|\ | | | | | | | | | | Conflicts: compiler/hsSyn/Convert.lhs compiler/hsSyn/HsDecls.lhs
| * Fix printing of type operators in declarations.Iavor S. Diatchki2012-03-241-2/+2
| |
| * Fix pretty-printing of type operators in imports/exports.Iavor S. Diatchki2012-03-242-6/+16
| | | | | | | | | | | | When we see a type operator in an import or an export, we tag it with the keyword 'type' so that it is not confused with value level operators with the same name.
| * Merge remote-tracking branch 'origin/master' into type-natsIavor S. Diatchki2012-03-194-31/+29
| |\
| * | Add an `Outputable` instance for `HsTyLit`Iavor S. Diatchki2012-03-181-0/+3
| | |
| * | Add TH support for type-level literals.Iavor S. Diatchki2012-03-151-0/+1
| | |