[GHC] #9330: Introduce shortcut for "on (==)" much like there's a shortcut for "on compare".

GHC ghc-devs at haskell.org
Fri Jul 18 15:45:06 UTC 2014


#9330: Introduce shortcut for "on (==)" much like there's a shortcut for "on
compare".
-------------------------------------+-------------------------------------
              Reporter:  frerich     |             Owner:
                  Type:  feature     |            Status:  new
  request                            |         Milestone:
              Priority:  normal      |           Version:  7.8.2
             Component:              |          Keywords:
  libraries/base                     |  Operating System:  Unknown/Multiple
            Resolution:              |   Type of failure:  None/Unknown
Differential Revisions:              |         Test Case:
          Architecture:              |          Blocking:
  Unknown/Multiple                   |
            Difficulty:  Unknown     |
            Blocked By:              |
       Related Tickets:              |
-------------------------------------+-------------------------------------

Comment (by ekmett):

 A couple of items:

 Historically, `comparing` was actually defined before `on` was added to
 `base`.

 Fear that we'd be duplicating that pattern over and over again for every
 other function under the sun led to the adoption of `on`. `equating` was
 explicitly the original motivation!

 `comparing` was left in because it was already there, but not _really_
 intended to be a pattern to copy,

 `on` was the general solution put forth to avoid precisely this
 repetition.

 The main reason why we should consider doing this is, well, frankly, it
 gets reinvented every 6 months, so by not doing it we seem to be on the
 wrong side of history. Eventually someone will say yes. ;)

 That said, library changes like this should go through a
 libraries at haskell.org request, rather than trac.

 Please submit this as a libraries@ mailing list proposal, that'll garner
 general sentiment and the core libraries committee can weigh in there.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9330#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list