summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsArrows.lhs
diff options
context:
space:
mode:
authorDan Licata <drl@cs.cmu.edu>2007-10-10 15:02:54 +0000
committerDan Licata <drl@cs.cmu.edu>2007-10-10 15:02:54 +0000
commit6a05ec5ef5373f61b7f9f5bdc344483417fa801b (patch)
tree0495fdd3fbf4baf72a092081f2c3f7cb46594374 /compiler/deSugar/DsArrows.lhs
parent6202305819577fce2b11ab509ed94422775df30e (diff)
downloadhaskell-6a05ec5ef5373f61b7f9f5bdc344483417fa801b.tar.gz
View patterns, record wildcards, and record puns
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.
Diffstat (limited to 'compiler/deSugar/DsArrows.lhs')
-rw-r--r--compiler/deSugar/DsArrows.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/deSugar/DsArrows.lhs b/compiler/deSugar/DsArrows.lhs
index 0ef7fa5f8c..7500111f4c 100644
--- a/compiler/deSugar/DsArrows.lhs
+++ b/compiler/deSugar/DsArrows.lhs
@@ -1115,7 +1115,7 @@ collectl (L l pat) bndrs
collectHsBindLocatedBinders ds
++ foldr collectl bndrs (hsConPatArgs ps)
go (LitPat _) = bndrs
- go (NPat _ _ _ _) = bndrs
+ go (NPat _ _ _) = bndrs
go (NPlusKPat n _ _ _) = n : bndrs
go (SigPatIn pat _) = collectl pat bndrs