[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-jhc
Subject:    [jhc] darcs patch: fix desugaring of irrefutable lambda bindings
From:       John Meacham <john () repetae ! net>
Date:       2010-08-10 5:50:31
Message-ID: 20100810055031.27672641F5 () sliver ! repetae ! net
[Download RAW message or body]

Mon Aug  9 22:39:44 PDT 2010  John Meacham <john@repetae.net>
  * fix desugaring of irrefutable lambda bindings

["fix-desugaring-of-irrefutable-lambda-bindings.dpatch" (text/x-darcs-patch)]

New patches:

[fix desugaring of irrefutable lambda bindings
John Meacham <john@repetae.net>**20100810053944
 Ignore-this: 5c70934cbe42169850481562cd5b20f3
] hunk ./src/FrontEnd/Desugar.hs 1
--- various desugaring routines
+    -- various desugaring routines
 --
 -- The general desugaring routine creates selectors for data
 -- constructors with named fields, changes all pattern bindings
hunk ./src/FrontEnd/Desugar.hs 12
 
 import Control.Monad.State
 
-import GenUtil
 import FrontEnd.HsSyn
 import Name.Name
 import Name.Names
hunk ./src/FrontEnd/Desugar.hs 157
 
 desugarExp :: (HsExp) -> PatSM (HsExp)
 desugarExp (HsLambda sloc pats e)
-    | all isLazyPat pats && not (any isHsPIrrPat pats) = do
+    | all isSimplePat pats  = do
         newE <- desugarExp e
         return (HsLambda sloc pats newE)
 desugarExp (HsLambda sloc pats e) = z where
hunk ./src/FrontEnd/Desugar.hs 228
     f (HsQualifier e:ss) = do
         ss <- f ss
         return $ HsInfixApp (hsParen e) (HsVar f_bind_) (hsParen ss)
-    f ((HsGenerator _srcLoc pat e):ss) | isLazyPat pat = do
+    f ((HsGenerator _srcLoc pat e):ss) | isSimplePat pat = do
         ss <- f ss
         return $ HsInfixApp (hsParen e) (HsVar f_bind) (HsLambda _srcLoc [pat] ss)
     f ((HsGenerator srcLoc pat e):ss) = do
hunk ./src/FrontEnd/Desugar.hs 289
     app x y = HsApp x (hsParen y)
 
 -- patterns are
--- failable - may fail to match
+-- failable - strict and may fail to match
 -- refutable or strict - may bottom out
 -- irrefutable or lazy - match no matter what
hunk ./src/FrontEnd/Desugar.hs 292
+-- simple, a wildcard or variable
 -- failable is a subset of refutable
 
 
hunk ./src/FrontEnd/Desugar.hs 299
 isFailablePat p | isStrictPat p = f (openPat p) where
     f (HsPTuple ps) = any isFailablePat ps
     f (HsPUnboxedTuple ps) = any isFailablePat ps
+    f (HsPBangPat (Located _ p)) = isFailablePat p
     f _ = True
 isFailablePat _ = False
 
hunk ./src/FrontEnd/Desugar.hs 303
+isSimplePat p = f (openPat p) where
+    f HsPVar {} = True
+    f HsPWildCard = True
+    f _ = False
+
+
 isLazyPat pat = not (isStrictPat pat)
 isStrictPat p = f (openPat p) where
     f HsPVar {} = False

Context:

[add some strictness annotations
John Meacham <john@repetae.net>**20100810053827
 Ignore-this: 15ed2e2fc90656cc418a841848e43107
] 
[clean ups
John Meacham <john@repetae.net>**20100806112820
 Ignore-this: 64c0ae0922073b65fc0dac4bd35ba968
] 
[speed up name choosing a little
John Meacham <john@repetae.net>**20100806111703
 Ignore-this: ac159eeb0d34a7d26ad74253d00386ae
] 
[further seperate out concrete types to speed up checking
John Meacham <john@repetae.net>**20100806092815
 Ignore-this: f992ced583042d3c7797d4de93e3e3a8
] 
[split type environment into concrete and mutable sets, to avoid retraversing the \
concrete imported types John Meacham <john@repetae.net>**20100806090349
 Ignore-this: c276618b4b968d9149e6b3dfc36d162a
] 
[create a better relation representation, speed up export chasing signifigantly
John Meacham <john@repetae.net>**20100806082622
 Ignore-this: 9f49871e33348bbfc4e8fd2ee9fa71b8
] 
[fix a few minor bugs in libraries found by better error reporting
John Meacham <john@repetae.net>**20100806045809
 Ignore-this: e7d43927c9e11b05de455a5d0ebd1017
] 
[check export lists for unknown names
John Meacham <john@repetae.net>**20100806045759
 Ignore-this: 4b3ff8381117f2acae34dd6b936c8e8d
] 
[ret rid of seperate subtable and errortable in favor of unified namemap
John Meacham <john@repetae.net>**20100806032455
 Ignore-this: 9e8fbd31f988d77614bd49fc23cefae
] 
[treat () the same as tuples when renaming
John Meacham <john@repetae.net>**20100806023948
 Ignore-this: defa66a11f1081a4582a5301cff217e4
] 
[move selector creation from desugar to renamer, detect multiply defined top level \
values and report an error properly. John Meacham <john@repetae.net>**20100806021241
 Ignore-this: 507bce69ec8ffe0085c3a72ffc0ec571
] 
[add initial version of jhc-prim
John Meacham <john@repetae.net>**20100806000900
 Ignore-this: 44a9f14db168b28d731fd750bba0fee9
] 
[clean up preprocessing a little
John Meacham <john@repetae.net>**20100803073754
 Ignore-this: c1064468bed864231c2d5fb3a68bbeaf
] 
[utilize preprocessor rather than ./configure to handle System.Info
John Meacham <john@repetae.net>**20100802100036
 Ignore-this: 76681affa5b0269621974deeccda019b
] 
[fix some warnings
John Meacham <john@repetae.net>**20100801083507
 Ignore-this: fd350fd02d0ad5a611ee1811de28bce5
] 
[fix build problem for tarball
John Meacham <john@repetae.net>**20100801082137
 Ignore-this: 33671b52398eef61afa670eb031ef575
] 
[update strictness and UNPACK annotations
John Meacham <john@repetae.net>**20100801080035
 Ignore-this: e598a6098143c1a62373a443865b3cfb
] 
[add announcement for 0.7.6
John Meacham <john@repetae.net>**20100731111353
 Ignore-this: 111c27548d94bdfe0042d61b02fe5728
] 
[TAG 0.7.6
John Meacham <john@repetae.net>**20100731104908
 Ignore-this: d5edc6edd6d300cbae451f0e056ee018
] 
Patch bundle hash:
fe4197aaeb701c189d35c778a1ce6ea9d7f7ade5



_______________________________________________
jhc mailing list
jhc@haskell.org
http://www.haskell.org/mailman/listinfo/jhc

.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic