Get a bit of sharing
authorIan Lynagh <igloo@earth.li>
Thu, 24 Jan 2008 15:20:00 +0000 (15:20 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 24 Jan 2008 15:20:00 +0000 (15:20 +0000)
compiler/parser/Parser.y.pp

index 7104a0d..515c474 100644 (file)
@@ -1221,8 +1221,9 @@ decl      :: { Located (OrdList (LHsDecl RdrName)) }
                                                return (LL $ unitOL $ LL $ ValD ( 
                                                        PatBind (LL $ BangPat pat) (unLoc $3)
                                                                placeHolderType placeHolderNames)) } }
-       | infixexp opt_sig rhs          {% do { r <- checkValDef $1 $2 $3;
-                                               return $! (LL $! (unitOL $! (LL $ ValD r))) } }
+        | infixexp opt_sig rhs          {% do { r <- checkValDef $1 $2 $3;
+                                                let { l = comb2 $1 $> };
+                                                return $! (sL l (unitOL $! (sL l $ ValD r))) } }
         | docdecl                       { LL $ unitOL $1 }
 
 rhs    :: { Located (GRHSs RdrName) }