[GHC] #2742: The -> in ViewPatterns binds more weakly than infix
data constructors.
GHC
trac at galois.com
Tue Nov 4 17:09:21 EST 2008
#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
More information about the Glasgow-haskell-bugs
mailing list