[GHC] #1087: Bang pattern parsing with infix ops
GHC
trac at galois.com
Fri Jan 5 20:41:08 EST 2007
#1087: Bang pattern parsing with infix ops
----------------------------------+-----------------------------------------
Reporter: dons | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Parser) | Version: 6.6
Severity: normal | Keywords: bang patterns
Difficulty: Easy (1 hr) | Testcase:
Architecture: Unknown | Os: Unknown
----------------------------------+-----------------------------------------
{{{
$ ghci -fbang-patterns
-- Ok
Prelude> let at a !b = False in at 1 2
False
Prelude> let (.!.) a !b = False in 1 .!. 2
False
-- ~ patterns are ok
Prelude> let a `at` ~b = False in at 1 2
False
Prelude> let a .!. ~b = False in 1 .!. 2
False
Prelude> let ~a .!. b = False in 1 .!. 2
False
-- Parse error if we combine bang patterns with infix decls:
Prelude> let a .!. !b = False in 1 .!. 2
<interactive>:1:10: parse error on input `!'
Prelude> let a `at` !b = False in at 1 2
<interactive>:1:11: parse error on input `!'
Prelude> let !a .!. b = False in 1 .!. 2
<interactive>:1:5: Parse error in pattern
}}}
So looks like ops and infix declarations are missing a case for bang
patterns.
-- Don
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1087>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list