| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
No concrete syntax yet, but I need to be able to use these in code
generated for derived Typeable instances.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Max spotted that the short-cut rules for desugaring NPats (where
we compare against a literal) were wrong now that we have overloaded
strings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Claus Reinke uncovered a long-standing bug in GHC, whereby we were
combining the pattern-match on overloaded literals, missing the fact
that an intervening pattern (for a different literal) might also
match. (If someone had a very odd implementation of fromInteger!)
See Note [Grouping overloaded literal patterns] in Match.lhs
If this merges smoothly to 6.10, go for it, but it's very much
a corner case.
Thank you Claus!
|
| |
|
| |
|
|
|
|
| |
Validate uses -Werror so the warnings broke it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The real work of fixing Trac #2246 is to use shortCutLit in
MatchLit.dsOverLit, so that type information discovered late in the
day by the type checker can still be exploited during desugaring.
However, as usual I found myself doing some refactoring along the
way, to tidy up the handling of overloaded literals. The main
change is to split HsOverLit into a record, which in turn uses
a sum type for the three variants. This makes the code significantly
more modular.
data HsOverLit id
= OverLit {
ol_val :: OverLitVal,
ol_rebindable :: Bool, -- True <=> rebindable syntax
-- False <=> standard syntax
ol_witness :: SyntaxExpr id, -- Note [Overloaded literal witnesses]
ol_type :: PostTcType }
data OverLitVal
= HsIntegral !Integer -- Integer-looking literals;
| HsFractional !Rational -- Frac-looking literals
| HsIsString !FastString -- String-looking literals
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements three new features:
* view patterns (syntax: expression -> pat in a pattern)
* working versions of record wildcards and record puns
See the manual for detailed descriptions.
Other minor observable changes:
* There is a check prohibiting local fixity declarations
when the variable being fixed is not defined in the same let
* The warn-unused-binds option now reports warnings for do and mdo stmts
Implementation notes:
* The pattern renamer is now in its own module, RnPat, and the
implementation is now in a CPS style so that the correct context is
delivered to pattern expressions.
* These features required a fairly major upheaval to the renamer.
Whereas the old version used to collect up all the bindings from a let
(or top-level, or recursive do statement, ...) and put them into scope
before renaming anything, the new version does the collection as it
renames. This allows us to do the right thing with record wildcard
patterns (which need to be expanded to see what names should be
collected), and it allows us to implement the desired semantics for view
patterns in lets. This change had a bunch of domino effects brought on
by fiddling with the top-level renaming.
* Prior to this patch, there was a tricky bug in mkRecordSelId in HEAD,
which did not maintain the invariant necessary for loadDecl. See note
[Tricky iface loop] for details.
|
| |
|
|
|
|
|
|
|
| |
Older GHCs can't parse OPTIONS_GHC.
This also changes the URL referenced for the -w options from
WorkingConventions#Warnings to CodingStyle#Warnings for the compiler
modules.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The class is named IsString with the single method fromString.
Overloaded strings work the same way as overloaded numeric literals.
In expressions a string literals gets a fromString applied to it.
In a pattern there will be an equality comparison with the fromString:ed literal.
Use -foverloaded-strings to enable this extension.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is a start on removing import lists and generally tidying
up the top of each module. In addition to removing import lists:
- Change DATA.IOREF -> Data.IORef etc.
- Change List -> Data.List etc.
- Remove $Id$
- Update copyrights
- Re-order imports to put non-GHC imports last
- Remove some unused and duplicate imports
|
|
|
|
|
|
|
|
| |
Mon Sep 18 16:41:32 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au>
* fix bugs, add boolean flag to identify coercion variables
Sun Aug 6 17:04:02 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au>
* fix bugs, add boolean flag to identify coercion variables
Tue Jul 25 06:20:05 EDT 2006 kevind@bu.edu
|
|
|
|
|
|
|
|
| |
Broken up massive patch -=chak
Original log message:
This is (sadly) all done in one patch to avoid Darcs bugs.
It's not complete work... more FC stuff to come. A compiler
using just this patch will fail dismally.
|
|
Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.
The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level. The build system now makes no
pretense at being multi-project, it is just the GHC build system.
No doubt this will break many things, and there will be a period of
instability while we fix the dependencies. A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
|