[GHC] #16155: Pattern Synonym for Ratio

#16155: Pattern Synonym for Ratio -------------------------------------+------------------------------------- Reporter: Zemyla | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Core | Version: 8.6.3 Libraries | Keywords: | Operating System: Unknown/Multiple PatternSynonyms, Ratio | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- `Data.Ratio` should export a simple pattern synonym that can be used by `Safe` code. {{{#!hs infixl 7 :%: pattern n :%: d <- n :% d where n :%: d = n % d }}} It'd be much simpler to use than `numerator` and `denominator`, and pattern matching on it would turn into a regular pattern match, hopefully for free. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16155 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16155: Pattern Synonym for Ratio -------------------------------------+------------------------------------- Reporter: Zemyla | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 8.6.3 Resolution: | Keywords: newcomer, | PatternSynonyms, Ratio 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 bgamari): * keywords: PatternSynonyms, Ratio => newcomer, PatternSynonyms, Ratio Comment: This sounds like a great idea but it would require changes to a library specified by the Report and consequently would require the approval of the [[https://wiki.haskell.org/Core_Libraries_Committee|Core Libraries Committee]]. Could you first bring this proposal to them? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16155#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC