[GHC] #10830: maximumBy has a space leak

GHC ghc-devs at haskell.org
Thu Jan 5 15:39:24 UTC 2017


#10830: maximumBy has a space leak
-------------------------------------+-------------------------------------
        Reporter:  NeilMitchell      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.2.1
       Component:  Core Libraries    |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1205
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 I'm happy with any resolution under which `maximumBy` on a `[a]` is
 defined in terms of `foldl1` (presuming that, as a result, strictness
 analysis can remove the space leak for `maximumBy` on a `[Int]`, as was
 the case in GHC 7.8). I didn't really mean to push for the "add a new
 method to `Foldable`" solution specifically. (That was motivated by
 maintaining the old behavior for other `Foldable` instances as far as
 possible, but if the old behavior is actually useless then that motivation
 doesn't apply.)

 If there's a minimal change that we could apply now to obtain the above
 condition, while leaving the door open to future extensions, I'd be in
 favor of making the minimal change now, since the current situation with
 `maximumBy` on lists is really not very good.

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


More information about the ghc-tickets mailing list