[GHC] #15131: Speed up certain Foldable NonEmpty methods

GHC ghc-devs at haskell.org
Thu May 10 20:42:33 UTC 2018


#15131: Speed up certain Foldable NonEmpty methods
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Core Libraries    |              Version:  8.2.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:D4677
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 GHC isn't clever enough to reassociate a recursively calculated sum, no.
 The `foldl'` definition you give ends up looking just the same as the
 default. As for `sum`, etc., I don't really think we should write worse
 code today because maybe some year the definition for lists will improve
 while the default definition doesn't. You can push for those changes
 separately, and in due course we can adjust this instance again if
 necessary.

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


More information about the ghc-tickets mailing list