I have a function that I want to test with several sets of inputs. Let's say the function is
f :: a -> b -> c
Now I have two lists of inputs:
inputA :: [a]
inputB :: [[b]]
For inputA !! i, I want evaluate f $ input !! i for each element of the list at inputB !! i. I know I need several applications of map to do this, but I am having difficulty wrapping my head around a solution.
My most recent attempt is
map f inputA <$> inputB
which gives the following error:
Couldn't match expected type
a0 -> b0' with actual type[b1]'
In the return type of a call ofmap'map' is applied to too many arguments
Probable cause:
In the first argument of(<$>)', namelymap f inputA'
In the expression: map f inputA inputB
How should I go about solving this problem? I don't necessarily want a complete solution. A push (or even a shove) in a helpful direction would definitely be appreciated.
Additional thoughts:
map f inputA :: [b -> c]
I think this is the right direction. Now I need to map each of the functions over each list of inputs in inputB.
To clarify, I want to map the ith function in map f inputA over the ith list of inputs in inputB to get a result outputC :: [[c]].