In this recipe, we will look at Data.Map. A map keeps an association between the key and the corresponding value. The map stores the ordered keys and their values (dictionaries). There are two variants of Map in the container library, strict and lazy. In this recipe, we will look at the strict variant. The lazy variant has the same interface, except that the implementation is lazy.
Working with maps
How to do it...
-
Create a new project work-with-map using the simple stack template.
- Add the containers library to the build-depends subsection of the executable subsection:
executable working-with-map hs-source-dirs: src main-is: Main.hs default-language: Haskell2010...