[GHC] #9345: Data.List.inits is extremely slow

GHC ghc-devs at haskell.org
Tue Jul 22 19:25:14 UTC 2014


#9345: Data.List.inits is extremely slow
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:              |           Version:  7.8.3
  libraries/base                     |          Keywords:
            Resolution:              |  Operating System:  Unknown/Multiple
Differential Revisions:              |   Type of failure:  Runtime
          Architecture:              |  performance bug
  Unknown/Multiple                   |         Test Case:
            Difficulty:  Easy (less  |          Blocking:
  than 1 hour)                       |
            Blocked By:              |
       Related Tickets:              |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Replying to [comment:1 nomeata]:

 > I would find it strange to add such complexity “just for” `inits`. Now,
 if we had such a `Queue` type (which looks useful in general) in base
 anyways, using it would be a different story...

 If it were added, it wouldn't be called `Queue`, because (unlike the real
 banker's queue) it's actually incapable of implementing `uncons`
 efficiently. It's really just a very limited, but very fast and light,
 list builder. If it's useful for things other than implementing `inits`, I
 would not be opposed to adding it in a separate module with some
 sufficiently clear name. I don't know enough about what sorts of things
 should and should not be provided by base to really comment much beyond
 that.

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


More information about the ghc-tickets mailing list