The type of map is:
:t map
(a -> b) -> [a] -> [b]
So if I would like to map a function with multiple parameters onto an array, something like:
myObviouslyFakeFunction :: Int -> Char -> String -> Char -> Integer -> String
myObviouslyFakeFunction -pattern- = -Very complex transform-
and do something like:
map (myObviouslyFakeFunction 1 'a' "abc" 'b' 2) ["abc", "def", "ghi"]
How could I do this? Would a in the type signature represent the first parameter? A tuple with all of them? A list?
(myObviouslyFakeFunction 1 'a' "abc" 'b' 2)is aString, not a function.myObvisoulyFakeFunction. You could partially apply a functiona1 -> a2 .. -> aN -> String -> bto create a functionString -> band pass that to map, butmyObviouslyFakeFunctiondoes not follow that pattern.f :: Int -> Int. Thenf 1is anInt.myObviouslyFakeFunction(1, 'a', "abc", 'b', 2)which would be a string, not a function.