Hello so I’m running a simple function in my ghci map sum $ transpose [[0,3,5,9],[10,0,0,9],[8,5,1,-1]]
and this is what the ghci returns,
<interactive>:12:2: error:
Ambiguous occurrence ‘map’
It could refer to
either ‘Prelude.map’,
imported from ‘Prelude’ at modules.hs:1:1
(and originally defined in ‘GHC.Base’)
or ‘Data.Map.map’,
imported from ‘Data.Map’ at modules.hs:5:1-15
(and originally defined in ‘Data.Map.Internal’)
I tried using qualified imports, here’s my code,
import Data.List (nub, sort) --you can selectively import functions
{-import Data.List hiding (nub) you're importing all functions accept the nub-}
-- import qualified Data.Map as M
-- Now, to reference Data.Map's filter function, we just use M.filter
import Data.Map
import qualified Data.Set
numUniques :: (Eq a) => [a] -> Int
numUniques = length . nub
Any suggestions?