summaryrefslogtreecommitdiff
path: root/compiler/deSugar/MatchLit.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Add 64-bit signed and unsigned integer literals to HsSyn.Simon Marlow2011-07-121-0/+4
| | | | | No concrete syntax yet, but I need to be able to use these in code generated for derived Typeable instances.
* Use FractionalLit more extensively to improve other pretty printersMax Bolingbroke2011-05-151-11/+11
|
* Record the original text along with parsed Rationals: fixes #2245Max Bolingbroke2011-05-151-4/+5
|
* Fix Trac #5117: desugar literal patterns consistenclySimon Peyton Jones2011-05-041-4/+10
|
* Remove GHC's haskell98 dependencyIan Lynagh2009-07-241-1/+1
|
* Fix Trac #3382: desugaring of NPatssimonpj@microsoft.com2009-07-201-27/+32
| | | | | | | Max spotted that the short-cut rules for desugaring NPats (where we compare against a literal) were wrong now that we have overloaded strings.
* Remove unused importsIan Lynagh2009-07-071-2/+0
|
* Fix Trac #3126: matching overloaded literalssimonpj@microsoft.com2009-03-301-9/+3
| | | | | | | | | | | | | | | 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!
* Remove redundant fromIntegral callsMax Bolingbroke2008-08-071-1/+1
|
* Handle introduction of MkCore in MatchLitMax Bolingbroke2008-07-311-7/+8
|
* FIX validate: Fix warnings in new literal codeRoman Leshchinskiy2008-05-071-1/+1
| | | | Validate uses -Werror so the warnings broke it.
* Fix Trac #2246; overhaul handling of overloaded literalssimonpj@microsoft.com2008-05-061-33/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make MatchLit warning-freeIan Lynagh2008-05-041-14/+23
|
* Add 123## literals for Word#Ian Lynagh2008-04-231-1/+4
|
* Monadify deSugar/MatchLit: use do, return, applicative, standard monad functionsTwan van Laarhoven2008-01-171-14/+14
|
* View patterns, record wildcards, and record punsDan Licata2007-10-101-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | 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.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-011-0/+7
|
* Warning fix for unused and redundant importsMichael D. Adams2007-05-101-2/+0
|
* Add more assertionssimonpj@microsoft.com2007-05-021-1/+2
|
* Add support for overloaded string literals.lennart@augustsson.net2006-12-211-0/+9
| | | | | | | | | | 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.
* Module header tidyup, phase 1Simon Marlow2006-10-111-17/+18
| | | | | | | | | | | | 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
* fix bugs, add boolean flag to identify coercion variablesManuel M T Chakravarty2006-09-201-1/+1
| | | | | | | | 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
* Massive patch for the first months work adding System FC to GHC #9Manuel M T Chakravarty2006-08-041-152/+92
| | | | | | | | 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.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+329
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.