[GHC] #13454: Operators not allowed as fields in Record Pattern Synonyms
#13454: Operators not allowed as fields in Record Pattern Synonyms -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 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: -------------------------------------+------------------------------------- I want to write the following record pattern synonym {{{#!hs pattern MkOp :: Op -> Exp -> Exp -> Exp pattern MkOp {(·), a, b} <- (splitOp -> Just ((·), a, b)) where MkOp (·) a b = a · b }}} given this code {{{#!hs data Exp = Val Int | Add Exp Exp | Mul Exp Exp deriving Show type Op = Exp -> Exp -> Exp splitOp :: Exp -> Maybe (Op, Exp, Exp) splitOp (Add a b) = Just (Add, a, b) splitOp (Mul a b) = Just (Mul, a, b) splitOp _ = Nothing }}} It works fine if `(·)` is replaced by `operator`. Fields of regular data types works just fine: {{{#!hs data F a = F { (·) :: a -> a -> a, x :: a, y :: a } f F{(·), x, y} = x·y g F{..} = x·y }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13454> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13454: Operators not allowed as fields in Record Pattern Synonyms -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3379 Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => patch * differential: => Phab:D3379 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13454#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13454: Operators not allowed as fields in Record Pattern Synonyms -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3379 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"154d224ade3d9f22b0e22fc8be8f3907f1ad51d2/ghc" 154d224a/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="154d224ade3d9f22b0e22fc8be8f3907f1ad51d2" Allow operators as record pattern synonym fields Fixes #13454 Reviewers: austin, bgamari, dfeuer Reviewed By: dfeuer Subscribers: RyanGlScott, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3379 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13454#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13454: Operators not allowed as fields in Record Pattern Synonyms -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3379 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13454#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC