[GHC] #9398: Data.List.cycle is not a good producer

GHC ghc-devs at haskell.org
Sun Aug 3 20:56:35 UTC 2014


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

Comment (by nomeata):

 I think you need to move the knot-tying into the argument to build, e.g.
 something like
 {{{
 cycle xs = build $ \c _ ->  let cyc = foldr c cyc xs in cyc
 }}}
 (ignoring the issue of `cycle []` for now)

 It seems that this would be both a good produce, and possibly even a good
 consumer.

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


More information about the ghc-tickets mailing list