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?
You can find such function by hoogling (a -> b -> c) -> [a] -> [b] -> [c]. Yes, it's called zipWith.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With