You should copy and paste the types you see, and not re-enter them into the question. The reason is that you were mistaken. Type for map take :
map take :: [Int] -> [[a] -> [a]]
In other words, unification works as such:
:t map map :: (a -> b) -> [a] -> [b] :t take take :: Int -> [c] -> [c]
therefore, applying take as the first argument to map , you get a ~ Int and b ~ [c] -> [c] (note that this is a function). Performing these replacements in the map type and applying the first argument:
map take :: [a] -> [b] (for some specific 'a' and 'b') -- recall a ~ Int map take :: [Int] -> [b] (for some specific 'b') -- recall b ~ [c] -> [c] map take :: [Int] -> [[c] -> [c]]
Yay, map take is exactly what you expect. A function that works on Ints lists and leads to a list of functions that will take a number of elements from the very beginning of the list.
source share