[GHC] #13086: (\\) in Data.List uses foldl instead of foldl'

GHC ghc-devs at haskell.org
Sun Jan 8 14:41:03 UTC 2017


#13086: (\\) in Data.List uses foldl instead of foldl'
-------------------------------------+-------------------------------------
        Reporter:  vaibhavsagar      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 It probably doesn’t make a difference. The accumulator here is of type
 `[a]` and the function passed to `foldl` is `delete`, which is lazy. So
 forcing the first element of the list will make `delete` only progress
 until the next retained element of the list, but the rest will still be a
 thunk.

 If you show some benchmarks indicating genuine improvement, we can
 certainly change this.

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


More information about the ghc-tickets mailing list