Skip to content

zipWith static argument transformation

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 _      _      = []
Trac metadata
Trac field Value
Version 7.0.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information