Error: Could not load module Data.Map

I got the above error along with It is a member of the hidden package containers-0.6.5.1. I made the import with:

import qualified Data.Map as Map

Does this mean that exercism haskell tests do not permit the use of Data.Map? After changing my code and looking at community solutions I saw an example where the Data.Map module was imported with the expression:

import qualified Data.Map as M
import Data.Map ((!?)), fromList)

This suggests that this import is permitted. Why not in my case?

I believe you have to add the package containers under “dependencies” in the package.yaml file of the exercise, like so:

dependencies:

- containers

Right now this part of the file should be commented, you have to remove the “#” from it.

1 Like

Thank you.

1 Like