The -> in ViewPatterns binds more weakly than infix data constructors.
|Reported by:||guest||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
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.
Change History (5)
comment:2 Changed 7 years ago by simonpj
- difficulty set to Unknown
- Milestone set to _|_
- Type changed from bug to feature request
comment:3 Changed 3 years ago by liyang
- Cc hackage.haskell.org@… added
- Type of failure set to None/Unknown