I am trying to do some self-learning with Haskell.
A function loadData reads some data off the file and based on an integer parameter does some processing on it to produce a Map. I need to create two such maps and apply a cosine similarity metric to it.I am trying to find the intersection of the two maps first. However, I run into a type error (Couldn't match expected type `a0 -> Map.Map k0 a1' with actual type `IO (Map.Map [Char] Double)') How can I feed the output of loadData to Map.intersection. Do I need a function applicator $?
loadData :: Int -> FilePath -> IO (Map.Map [Char] Double)
Map.intersection :: Ord k => Map.Map k a -> Map.Map k b -> Map.Map k a
Something like this:
Note that the result of this has type
IO (Map.Map String Double).