[GHC] #11212: Should be more liberal parsing pattern synonyms with view patterns

#11212: Should be more liberal parsing pattern synonyms with view patterns -------------------------------------+------------------------------------- Reporter: mpickering | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple PatternSynonyms | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Redundant parentheses are required around a view pattern if it is used on the RHS of a pattern synonym definition. I think that parsing should be relaxed to allow the first definition. {{{ -- Fails to parse, bug? pattern IsTrue :: Show a => a pattern IsTrue <- (== "True") . show -> True -- Parses pattern IsTrue :: Show a => a pattern IsTrue <- ((== "True") . show -> True) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11212 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11212: Should be more liberal parsing pattern synonyms with view patterns -------------------------------------+------------------------------------- Reporter: mpickering | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => Compiler (Parser) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11212#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11212: Should be more liberal parsing pattern synonyms with view patterns -------------------------------------+------------------------------------- Reporter: mpickering | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I'm not sure actually. The former is really quite hard to parse, to my eyes! But I don't feel strongly. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11212#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11212: Should be more liberal parsing pattern synonyms with view patterns -------------------------------------+------------------------------------- Reporter: mpickering | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Parser) | Keywords: Resolution: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): With `-XMultiWayIf`, `if | Just True <- Just True -> True` is a valid expression. It looks similar to the example in this ticket: two arrows in opposite directions, no parenthesis. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11212#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC