[GHC] #4976: zipWith static argument transformation

GHC cvs-ghc at haskell.org
Wed Feb 23 19:59:59 CET 2011


#4976: zipWith static argument transformation
---------------------------------+------------------------------------------
    Reporter:  aristidb          |       Owner:                
        Type:  feature request   |      Status:  new           
    Priority:  normal            |   Component:  libraries/base
     Version:  7.0.1             |    Keywords:                
    Testcase:                    |   Blockedby:                
          Os:  Unknown/Multiple  |    Blocking:                
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown  
---------------------------------+------------------------------------------
 Currently, zipWith cannot be inlined (I think), because it is implemented
 as such:

 {{{
 zipWith :: (a->b->c) -> [a]->[b]->[c]
 zipWith f (a:as) (b:bs) = f a b : zipWith f as bs
 zipWith _ _      _      = []
 }}}

 So why not apply this SAT:

 {{{
 zipWith f = go
   where go (a:as) (b:bs) = f a b : go as bs
         go _      _      = []
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4976>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list