#2742: The -> in ViewPatterns binds more weakly than infix data constructors.
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Component:  Compiler        
     Version:  6.10.1            |    Severity:  normal          
    Keywords:                    |    Testcase:                  
Architecture:  Unknown/Multiple  |          Os:  Unknown/Multiple
---------------------------------+------------------------------------------
 The following code, essentially taken from the ViewPatterns page on the
 wiki doesn't seem to parse correctly.

 {{{
 mymap f [] = []
 mymap f (x : mymap f -> xs) = f x : xs
 }}}

 However, this does:

 {{{
 mymap f [] = []
 mymap f (x : (mymap f -> xs)) = f x : xs
 }}}

 (though it triggers bug #2395 about overlapping patterns)

 It would seem nicer to make the view pattern arrow bind ''tighter'' than
 any infix data constructors.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2742>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to