#7436: Derived Foldable and Traversable instances become extremely inefficient 
to eta-expansion
    Reporter:  shachaf           |       Owner:                         
        Type:  bug               |      Status:  patch                  
    Priority:  normal            |   Milestone:                         
   Component:  Compiler          |     Version:  7.6.1                  
    Keywords:                    |          Os:  Unknown/Multiple       
Architecture:  Unknown/Multiple  |     Failure:  Runtime performance bug
  Difficulty:  Unknown           |    Testcase:                         
   Blockedby:                    |    Blocking:                         
     Related:                    |  
Changes (by simonpj):

 * cc: twanvl, dreixel (added)


 OK, let's wrap this one up.

  * Thank you for the patch.  Are you confident that it's good to go?
 '''Pedro''' I believe that you were responsible for at least some of the
 `Traversable` deriving code; can you give an opinion?

  * I wonder if you could add some comments to explain the construction?
 As you say, it may generate slightly strange code.  Something like `Note
 [Avoid eta-expanded code]` with a compact explanation, an example, and a
 pointer to this ticket, would be useful.

  * Are there are there any library changes?

  * I looked at the eta-expansion thing.  Yes, GHC is doing the right thing
 here, as you show.  You might wonder why GHC doesn't eta-reduce `(\e -> s
 e)` to `s`.  The reason is that doing so is unsound if `s` is bottom; then
 eta-reduction might turn a terminating program into a non-terminating one.

 Then I'll commit it.


Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7436#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

Glasgow-haskell-bugs mailing list

Reply via email to