Opened 10 months ago

Last modified 9 months ago

#16155 new feature request

Pattern Synonym for Ratio

Reported by: Zemyla Owned by:
Priority: normal Milestone:
Component: Core Libraries Version: 8.6.3
Keywords: newcomer, PatternSynonyms, Ratio Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Data.Ratio should export a simple pattern synonym that can be used by Safe code.

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.

Change History (1)

comment:1 Changed 9 months ago by bgamari

Keywords: newcomer added

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 Core Libraries Committee. Could you first bring this proposal to them?

Note: See TracTickets for help on using tickets.