Let's say I have a list of functions
functions = [f, g, h]
each one with type a -> a
I also have a list of values, say numbers but anything should work here
vals = [1,2,3]
I want to apply each function in functions
to the corresponding value in vals
My first instinct is to use a lambda and zipWith like:
zipWith (\f v -> f v) functions vals
But frankly this looks ugly and not something I'd expect in such a nice language like Haskell. A function application function sounds like the solution. Is there such a thing? Am I missing something and there is a much nicer solution to my problem? I actually ended-up writing this construct for a Project Euler solution. It works, but I don't like it.