user15263733
user15263733

Reputation: 83

Haskell map function for two lists

I need to apply a function to two lists. The map function is map :: (a->b) -> [a] -> [b], however I need something more like map2 :: (a->b->c) -> [a] -> [b] -> [c]. Is there a prelude function similar to map that can do this?

Upvotes: 3

Views: 409

Answers (1)

snak
snak

Reputation: 6703

You can find such function by hoogling (a -> b -> c) -> [a] -> [b] -> [c]. Yes, it's called zipWith.

Upvotes: 9

Related Questions