import Data.Map as Map
test :: Int -> Int -> Map -> Map
test key value cache = Map.insert key value cache
Error:
`Map' is not applied to enough type arguments
Expected kind `??', but `Map' has kind `* -> * -> *'
In the type signature for `test': test :: Int -> Int -> Map -> Map
How can I declare the function to pass Data.Map as parameter?
You have to say what it is a map of.
Your keys are
Ints and the values you’re storing are alsoInts, so your map has typeMap Int Int.If the keys were
Strings and the values wereBools, the map would have typeMap String Bool.