[GHC] #15566: Implement minimumOn, maximumOn to mirror sortOn

GHC ghc-devs at haskell.org
Wed Aug 29 06:05:53 UTC 2018


#15566: Implement minimumOn, maximumOn to mirror sortOn
-------------------------------------+-------------------------------------
        Reporter:  Garciat           |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:  Research
                                     |  needed
       Component:  libraries/base    |              Version:  8.5
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  D5110
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 Will we want the total variants, with `Foldable1` constraints (#13573)

 {{{#!hs
 maximumOn, minimumOn :: Foldable1 f1 => Ord cmp => (a -> cmp) -> (f1 a ->
 a)
 maximumOn = maximumBy . comparing
 minimumOn = minimumBy . comparing
 }}}

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


More information about the ghc-tickets mailing list