[GHC] #9538: unwords does not participate in list fusion

GHC ghc-devs at haskell.org
Tue Sep 2 09:04:34 UTC 2014


#9538: unwords does not participate in list fusion
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  bug         |           Status:  closed
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.2
            Resolution:  invalid     |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Description changed by slyfox:

Old description:

> I'm not quite sure how far this can go, but `unwords` should almost
> certainly be a good consumer or a good consumer. Currently it is neither.
> Making it a good consumer is trivial, given `concatMap` that fuses:
>
> {{{#!hs
> unwords = tail . concatMap (' ':)
> }}}
>
> Alternatively, we should be able to make it a good producer without too
> much trouble, I think. I have my doubts about making it both.

New description:

 I'm not quite sure how far this can go, but `unwords` should almost
 certainly be a good consumer or a good producer. Currently it is neither.
 Making it a good consumer is trivial, given `concatMap` that fuses:

 {{{#!hs
 unwords = tail . concatMap (' ':)
 }}}

 Alternatively, we should be able to make it a good producer without too
 much trouble, I think. I have my doubts about making it both.

--

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


More information about the ghc-tickets mailing list