again another question generated by my attempts at the Project Euler questions (follow on from a previous question). I'm having trouble understanding the following line:
print (maximum (map (product . take 13) (tails number)))
Specifically
map (product . take 13) (tails number)
The type signature for the first argument of map from ghci is [c] -> c:
ghci> :t (product . take 13)
(product . take 13) :: Num c => [c] -> c
The type signature for map (product . take 13)
from ghci is [[b]] -> [b]:
ghci> :t map (product . take 13)
map (product . take 13) :: Num b => [[b]] -> [b]
Am I right in saying that as the first argument of map should be a function, [[b]] is not referring to a list of lists, but rather to a list of (partially applied) functions generated by (product . take 13)
, with the second argument for the partial functions coming from (tails number)
?