Posted By

deepsoul on 09/16/09


Tagged

list-of-functions zipWith


Versions (?)

Apply list of functions to list of arguments, one-to-one


 / Published in: Haskell
 

Easy if you know how... ;)

  1. zid :: [a -> b] -> [a] -> [b]
  2. zid = zipWith id
  3. -- zipWith ($) also works
  4.  
  5. -- example usage:
  6. fs = map (*) [1..5]
  7. xs = reverse [2..6]
  8. ys = zid fs xs
  9. -- ys is [6,10,12,12,10]

Report this snippet  

You need to login to post a comment.