| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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").
|
| |
|
|
|
|
| |
Also adds RULES and 'SPECIALIZE instance' support.
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
Fixes Trac #7074
|
| |\ |
|
| | | |
|
| | | |
|
| |/ |
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
Conflicts:
compiler/typecheck/TcRnDriver.lhs
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/
|/| |
|
| | |
|
|/
|
|
|
| |
This is when converting from TH -> HsSyn
Thanks to Richard Eisenberg
|
| |
|
|
|
|
| |
Fixes Trac #6118
|
| |
|
|
|
|
| |
Thanks to mikhail.vorozhtsov for doing the work
|
|
|
|
| |
Haskell
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Signed-off-by: Paolo Capriotti <p.capriotti@gmail.com>
|
|\
| |
| |
| |
| |
| | |
Conflicts:
compiler/hsSyn/Convert.lhs
compiler/hsSyn/HsDecls.lhs
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
| |\ |
|
| | | |
|
| | | |
|