| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 6549c3e569d0e0c3714814860201924432da2435
Author: Trevor Elliott <trevor@galois.com>
Date: Sun Sep 8 16:43:42 2013 -0700
Document `data kind` syntax
commit 81c6d7b884e819cf0b0569cef23b67bb5aff8944
Merge: 6c3f34c c798a8c
Author: Trevor Elliott <trevor@galois.com>
Date: Sun Sep 8 11:40:47 2013 -0700
Merge remote-tracking branch 'head/master' into data-kind-syntax-v2
commit 6c3f34c80bd8b17920a956e194ec29d1affbd776
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Wed Aug 28 02:21:07 2013 -0400
Merge with the roles changes
There a bunch of spots where the roles haven't been properly integrated with,
so this patch should get some review.
commit 6bb530f50f655e74fb4e337311699eee46b519b7
Merge: 7d27880 4b5238a
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Tue Aug 27 02:35:55 2013 -0400
Merge remote-tracking branch 'head/master' into data-kind-syntax-v2
Conflicts:
compiler/basicTypes/DataCon.lhs
compiler/iface/IfaceSyn.lhs
compiler/main/PprTyThing.hs
compiler/parser/Lexer.x
compiler/parser/Parser.y.pp
compiler/typecheck/TcInstDcls.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/typecheck/TcTyDecls.lhs
compiler/types/TyCon.lhs
commit 7d2788021dab549ffd888deb9f28c8e7eab0d4ba
Author: Trevor Elliott <trevor@galois.com>
Date: Mon Jul 29 09:05:38 2013 -0700
Migrate through some lost instances
commit 13e1f41ec9252fd9d547d8e4b9fb04ffaf43c105
Merge: e051060 9e185cc
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Sun Jul 28 14:28:05 2013 -0400
Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2
Moved Binary instances for data-kind related types to IfaceSyn
commit e051060bbef4d359f2b1caa1c6135b23df17ffe7
Merge: 08d7c2f 2f99cdb
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Wed Jul 17 01:58:16 2013 -0400
Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2
commit 08d7c2fca10a8c89b6fd638536a28972753ae360
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Mon Jul 1 21:56:48 2013 -0400
Fix some bugs from the merge with master
* Figure out what the right choice for the kind checking strategy of kind decls
should be
commit 12f055d23a1b5c0a74d2db0784b779b605f3888f
Merge: f0adbdc e56b9d5
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Mon Jul 1 21:12:47 2013 -0400
Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2
Conflicts:
compiler/typecheck/TcTyClsDecls.lhs
commit f0adbdc29fefc54675f0960e3178f3b079058eea
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Sun Jun 23 15:53:06 2013 -0400
Swap the names for PromotionFlavor and PromotionInfo
commit e177270dc002f45286a9b644935ea339d8a6c8d3
Merge: 16df4be 3660ef9
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Sat Jun 22 04:00:15 2013 -0400
Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2
commit 16df4beac24065d3075a65b26add543452d1f2b2
Merge: b021b30 569b265
Author: Trevor Elliott <awesomelyawesome@gmail.com>
Date: Sat Jun 22 02:41:14 2013 -0400
merge with master
commit b021b30f66fdb66965f6c57fb0969317c9aeb9e3
Author: Trevor Elliott <trevor@galois.com>
Date: Thu Jun 20 19:39:20 2013 -0700
Start reworking comments
commit b765370181571c1922b508f8dd17648a090ac248
Merge: d1ac794 e4fc6fd
Author: Trevor Elliott <trevor@galois.com>
Date: Thu Jun 20 18:27:43 2013 -0700
Merge branch 'master' into data-kind-syntax-v2
commit d1ac794b5bd06ae04e014cabe4560628b70fcdeb
Merge: 9ad0a3c 73991d6
Author: Trevor Elliott <trevor@galois.com>
Date: Thu Jun 20 18:16:15 2013 -0700
Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2
commit 9ad0a3c57a5b77f5040f1201b2c53a84680c1af2
Author: Trevor Elliott <trevor@galois.com>
Date: Thu Jun 20 18:13:58 2013 -0700
Don't add the promotion tick to data kind constructors
commit 8c37784e31702ecf7d91f2d7cf7dfab675a56927
Merge: 4dff379 db9b631
Author: Trevor Elliott <trevor@galois.com>
Date: Mon Jun 17 10:55:51 2013 -0700
Merge remote-tracking branch 'origin/master' into data-kind-syntax-v2
Conflicts:
compiler/main/PprTyThing.hs
compiler/rename/RnTypes.lhs
compiler/types/TyCon.lhs
commit 4dff3791ac9d1175d26f8c3b44923aefbe6c3f40
Author: Trevor Elliott <trevor@galois.com>
Date: Mon Jun 3 20:45:00 2013 -0700
When parsing interfaces, use forkM while checking type constructors
commit 7903009475b3e89aecc0a8e5d328ea84ea53a39d
Author: Trevor Elliott <trevor@galois.com>
Date: Mon Jun 3 20:06:40 2013 -0700
When parsing data kind declarations, don't change the constructor namespace
commit 78ff545601cedba106eda05a38ce8f24f8480961
Author: Trevor Elliott <trevor@galois.com>
Date: Mon May 27 18:45:52 2013 -0700
Switch from Maybe TyCon to a richer type for promotion
The new type distinguishes the two cases where promotion isn't possible:
1) Promotion isn't possible, as it's disabled by a 'data type' declaration
2) Promotion isn't possible because we don't know how to promote it
commit 0573fd3e8f9822171ddeb0df937e10075b653678
Author: Trevor Elliott <trevor@galois.com>
Date: Mon May 27 17:36:21 2013 -0700
Remove an old TODO
commit e218d5d6848109e9dea129250199115a9db6b1d9
Author: Trevor Elliott <trevor@galois.com>
Date: Mon May 27 17:36:15 2013 -0700
Properly print data kind declarations in ghci
commit 22b011d43f84cb0478eded613344e1dd165664e5
Author: Trevor Elliott <trevor@galois.com>
Date: Thu May 16 18:38:22 2013 -0700
Switch to using the PromotedDataCon for the RHS of a data kind
Something is still wrong here: doing :browse will get a panic for some
reason.
commit 12db8c704765d2775b0299c2e718d015577a6f18
Author: Trevor Elliott <trevor@galois.com>
Date: Sat May 4 19:06:43 2013 -0700
Thread data kind syntax through the interface
Things are not quite right at the moment. The issue is that we can't
distinguish abstract types from types that are constructors in a data kind.
As such, we should introduce a new constructor to TyCon to help
disambiguate these two cases. Also it might be nice to add a new TyCon
for kinds, which would avoid the need for a new RHS in the AlgTyCon case.
commit 73f19612444e2a3b1534ab41f02449c9a5191ccb
Author: Trevor Elliott <trevor@galois.com>
Date: Tue Apr 30 20:30:21 2013 -0700
Handle kind declarations separately
commit 8d3bf040748026829382c5d13421f910b3f9fcf9
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 20:40:49 2013 -0700
Partial type-kind checking of `data kind` declarations
commit 2399eb788ed0fe571c22de4f810080a323ddaceb
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 18:01:28 2013 -0700
Support empty `data kind` declarations
commit 61a28f2df42b34742219a97a22c029f840fef7f5
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 17:34:31 2013 -0700
Rename `data kind` declarations
commit 5d3485a3e3ab7a78f1055b872f78203d5d005b76
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 16:53:26 2013 -0700
Fix a typo in a parser comment
commit 7f631cf41a3ca84cd820b292711014b4e806a440
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 16:53:00 2013 -0700
Add paring for `data kind` declarations
commit d29733901b2cd195989cdc972ac74c1ed4f19670
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 14:31:30 2013 -0700
Rename typeLiteralsBit to dataKindsBit in the lexer
commit ca8ae194826fc47a2ba4f0188d62f5247b0fe631
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 14:27:50 2013 -0700
Add a check for -XDataKinds when parsing a `data type` declaration
commit 8588717e8ce224affa584bd1e27aa14e098f5a8f
Author: Trevor Elliott <trevor@galois.com>
Date: Fri Apr 26 14:18:41 2013 -0700
Implement the 'data type' syntax and checking
Add a new form of data declaration where the 'type' modifier can be used
to prevent data promotion. For example
data type T = K
will not yield a promoted kind T, and promoted type K, even though they are
in principle promotable.
|
| |
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under -XNumDecimals, it's possible to specify an integer literal using
compact "floating point" syntax for any floating literal constant which
also happens to be an integer. This lets us write
1.2e6 :: Integer
instead of:
1200000 :: Integer
This also makes some amendments to the users guide.
Authored-by: Shachaf Ben-Kiki <shachaf@gmail.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
|
| |
The `-dumpdir` flag was added via 668c860b361f16 but failed to
take care of `-ddump-minimal-imports`'s output.
This commit makes up for that omission.
This addresses #7957
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
| |
I'd still prefer if a native english speaker would check them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Roles are a solution to the GeneralizedNewtypeDeriving type-safety
problem.
Roles were first described in the "Generative type abstraction" paper,
by Stephanie Weirich, Dimitrios Vytiniotis, Simon PJ, and Steve Zdancewic.
The implementation is a little different than that paper. For a quick
primer, check out Note [Roles] in Coercion. Also see
http://ghc.haskell.org/trac/ghc/wiki/Roles
and
http://ghc.haskell.org/trac/ghc/wiki/RolesImplementation
For a more formal treatment, check out docs/core-spec/core-spec.pdf.
This fixes Trac #1496, #4846, #7148.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
You ought to be able to say
module M( C( T, foo ) where
class C a where
type T a
foo :: a -> T a
i.e. with T in C's sub-item list. This makes it so.
|
| |
|
|
|
|
|
|
|
|
| |
When we changed 'rec' to *not* do segmentation of any kind,
I did it by meddling with the inner loop of grab in glomSegments.
But that is really hard to understand!
This patch lifts the test out to the top where is is clear.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the syntax and story around overlapping type
family instances. Before, we had "unbranched" instances and
"branched" instances. Now, we have closed type families and
open ones.
The behavior of open families is completely unchanged. In particular,
coincident overlap of open type family instances still works, despite
emails to the contrary.
A closed type family is declared like this:
> type family F a where
> F Int = Bool
> F a = Char
The equations are tried in order, from top to bottom, subject to
certain constraints, as described in the user manual. It is not
allowed to declare an instance of a closed family.
|
|
|
|
|
|
| |
Clang doesn't like whitespace between macro and arguments.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
| |
The ideclImplicit flag didn't exist before, but it does now,
and it makes this code simpler and makes it easy to fix Trac #7963.
|
| |
|
| |
|
| |
|
|
|
|
| |
This fixes Trac #7937
|
| |
|
|
|
|
| |
Removed a definition of thenM, and used do notation instead
|
|
|
|
|
|
|
|
| |
We simply weren't quantifying kind variables at the points we
were claiming. In paritcular, in
forall (a:k). blah
we quantify the 'k' around the 'forall a', provided k isn't
already in scope
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The typechecking of arrow forms (in GHC 7.6) is known to be bogus, as
described in Trac #5609, because it marches down tuple types that may
not yet be fully worked out, depending on when constraint solving
happens. Moreover, coercions are generated and simply discarded. The
fact that it works at all is a miracle.
This refactoring is based on a conversation with Ross, where we
rearranged the typing of the argument stack, so that the arrows
have the form
a (env, (arg1, (arg2, ...(argn, ())))) res
rather than
a (arg1, (arg2, ...(argn, env))) res
as it was before.
This is vastly simpler to typecheck; just look at the beautiful,
simple type checking of arrow forms now!
We need a new HsCmdCast to capture the coercions generated from
the argument stack.
This leaves us in a better position to tackle the open arrow tickets
* Trac #5777 still fails. (I was hoping this patch would cure it.)
* Trac #5609 is too complicated for me to grok. Ross?
* Trac #344
* Trac #5333
|
|
|
|
| |
AnnProvenance now has Functor, Foldable, Traversable instances.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This work was all done by
Achim Krause <achim.t.krause@gmail.com>
George Giorgidze <giorgidze@gmail.com>
Weijers Jeroen <jeroen.weijers@uni-tuebingen.de>
It allows list syntax, such as [a,b], [a..b] and so on, to be
overloaded so that it works for a variety of types.
The design is described here:
http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists
Eg. you can use it for maps, so that
[(1,"foo"), (4,"bar")] :: Map Int String
The main changes
* The ExplicitList constructor of HsExpr gets witness field
* Ditto ArithSeq constructor
* Ditto the ListPat constructor of HsPat
Everything else flows from this.
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
compiler/rename/RnSource.lhs
compiler/simplCore/OccurAnal.lhs
compiler/vectorise/Vectorise/Exp.hs
NB: Merging instead of rebasing for a change. During rebase Git got confused due to the lack of the submodules in my quite old fork.
|
| |
| |
| |
| |
| |
| |
| | |
* Vectorisation avoidance is now the default
* Types and values from unvectorised modules are permitted in scalar code
* Simplified the VECTORISE pragmas (see http://hackage.haskell.org/trac/ghc/wiki/DataParallel/VectPragma for the spec)
* Vectorisation information is now included in the annotated Core AST
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
compiler/types/Coercion.lhs
|
| | | |
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
The idea is that you can use "_foo" rather than just "_"
as a "hole" in an expression, and this name shows up in
type errors etc.
The changes are very straightforward.
Thanks for Thijs Alkemade for making the running here.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Make MatchGroup into a record, and use the record fields
* Split the type field into two: mg_arg_tys and mg_res_ty
This makes life much easier for the desugarer when the
case alterantives are empty
A little bit of this change unavoidably ended up in the preceding
commit about empty case alternatives
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The main changes are:
* Parser accepts empty case alternatives
* Renamer checks that -XEmptyCase is on in that case
* (Typechecker is pretty much unchanged.)
* Desugarer desugars empty case alternatives, esp:
- Match.matchWrapper and Match.match now accept empty eqns
- New function matchEmpty deals with the empty case
- See Note [Empty case alternatives] in Match
This patch contains most of the work, but it's a bit mixed up
with a refactoring of MatchGroup that I did at the same time
(next commit).
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An ordered, overlapping type family instance is introduced by 'type
instance
where', followed by equations. See the new section in the user manual
(7.7.2.2) for details. The canonical example is Boolean equality at the
type
level:
type family Equals (a :: k) (b :: k) :: Bool
type instance where
Equals a a = True
Equals a b = False
A branched family instance, such as this one, checks its equations in
order
and applies only the first the matches. As explained in the note
[Instance
checking within groups] in FamInstEnv.lhs, we must be careful not to
simplify,
say, (Equals Int b) to False, because b might later unify with Int.
This commit includes all of the commits on the overlapping-tyfams
branch. SPJ
requested that I combine all my commits over the past several months
into one
monolithic commit. The following GHC repos are affected: ghc, testsuite,
utils/haddock, libraries/template-haskell, and libraries/dph.
Here are some details for the interested:
- The definition of CoAxiom has been moved from TyCon.lhs to a
new file CoAxiom.lhs. I made this decision because of the
number of definitions necessary to support BranchList.
- BranchList is a GADT whose type tracks whether it is a
singleton list or not-necessarily-a-singleton-list. The reason
I introduced this type is to increase static checking of places
where GHC code assumes that a FamInst or CoAxiom is indeed a
singleton. This assumption takes place roughly 10 times
throughout the code. I was worried that a future change to GHC
would invalidate the assumption, and GHC might subtly fail to
do the right thing. By explicitly labeling CoAxioms and
FamInsts as being Unbranched (singleton) or
Branched (not-necessarily-singleton), we make this assumption
explicit and checkable. Furthermore, to enforce the accuracy of
this label, the list of branches of a CoAxiom or FamInst is
stored using a BranchList, whose constructors constrain its
type index appropriately.
I think that the decision to use BranchList is probably the most
controversial decision I made from a code design point of view.
Although I provide conversions to/from ordinary lists, it is more
efficient to use the brList... functions provided in CoAxiom than
always to convert. The use of these functions does not wander far
from the core CoAxiom/FamInst logic.
BranchLists are motivated and explained in the note [Branched axioms] in
CoAxiom.lhs.
- The CoAxiom type has changed significantly. You can see the new
type in CoAxiom.lhs. It uses a CoAxBranch type to track
branches of the CoAxiom. Correspondingly various functions
producing and consuming CoAxioms had to change, including the
binary layout of interface files.
- To get branched axioms to work correctly, it is important to have a
notion
of type "apartness": two types are apart if they cannot unify, and no
substitution of variables can ever get them to unify, even after type
family
simplification. (This is different than the normal failure to unify
because
of the type family bit.) This notion in encoded in tcApartTys, in
Unify.lhs.
Because apartness is finer-grained than unification, the tcUnifyTys
now
calls tcApartTys.
- CoreLinting axioms has been updated, both to reflect the new
form of CoAxiom and to enforce the apartness rules of branch
application. The formalization of the new rules is in
docs/core-spec/core-spec.pdf.
- The FamInst type (in types/FamInstEnv.lhs) has changed
significantly, paralleling the changes to CoAxiom. Of course,
this forced minor changes in many files.
- There are several new Notes in FamInstEnv.lhs, including one
discussing confluent overlap and why we're not doing it.
- lookupFamInstEnv, lookupFamInstEnvConflicts, and
lookup_fam_inst_env' (the function that actually does the work)
have all been more-or-less completely rewritten. There is a
Note [lookup_fam_inst_env' implementation] describing the
implementation. One of the changes that affects other files is
to change the type of matches from a pair of (FamInst, [Type])
to a new datatype (which now includes the index of the matching
branch). This seemed a better design.
- The TySynInstD constructor in Template Haskell was updated to
use the new datatype TySynEqn. I also bumped the TH version
number, requiring changes to DPH cabal files. (That's why the
DPH repo has an overlapping-tyfams branch.)
- As SPJ requested, I refactored some of the code in HsDecls:
* splitting up TyDecl into SynDecl and DataDecl, correspondingly
changing HsTyDefn to HsDataDefn (with only one constructor)
* splitting FamInstD into TyFamInstD and DataFamInstD and
splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl
* making the ClsInstD take a ClsInstDecl, for parallelism with
InstDecl's other constructors
* changing constructor TyFamily into FamDecl
* creating a FamilyDecl type that stores the details for a family
declaration; this is useful because FamilyDecls can appear in classes
but
other decls cannot
* restricting the associated types and associated type defaults for a
* class
to be the new, more restrictive types
* splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts,
according to the new types
* perhaps one or two more that I'm overlooking
None of these changes has far-reaching implications.
- The user manual, section 7.7.2.2, is updated to describe the new type
family
instances.
|
| | |
|
| |
| |
| |
| |
| | |
We were mixing up the *implicit* import of Prelude
with a user-written import declaration
|
| |
| |
| |
| | |
Fixes Trac #7404
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
See Note [Newtype constructor usage in foreign declarations] in TcForeign.
It's quite non-trivial to say which newtype constructor are used in
foreign import/export declarations, and I had to do a bit of refactoring
to achieve it. (Say hello to the X5 bus from Oxford to Cambridge.)
It's a bit tiresome, with some more plumbing, but not hard.
Trac #7048 triggered this change.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Occurrences in terms are uses, in patterns they are not.
In this way we get unused-constructor warnings from modules like this
module M( f, g, T ) where
data T = T1 | T2 Bool
f x = T2 x
g T1 = True
g (T2 x) = x
Here a T1 value cannot be constructed, so we can warn. The use
in a pattern doesn't count. See Note [Patterns are not uses]
in RnPat.
Interestingly this change exposed three module in GHC itself
that had unused constructors, which I duly removed:
* ghc/Main.hs
* compiler/ghci/ByteCodeAsm
* compiler/nativeGen/PPC/RegInfo
Their changes are in this patch.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
Mostly d -> g (matching DynFlag -> GeneralFlag).
Also renamed if* to when*, matching the Haskell if/when names
|
|/ /
| |
| |
| | |
Fixes Trac #7338
|
| |
| |
| |
| | |
patch submitted by marcotmarcot@gmail.com
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
We only warn when the method is used, not when it is defined as part
of an instance.
|