How it works...
We have seen common functions for dealing with map. Typically, the function without the suffix With or WithKey has default behavior. For example, in insert, the default behavior is to replace the existing value. The suffix With takes two values to produce a new value. The suffix WithKey also takes into consideration the key for which we are combining values.
There are two variants of map, Data.Map.Strict and Data.Map.Lazy. Both the modules export the same function names. These functions vary in their strictness. The strict map will immediately evaluate the resulting map, whereas the lazy map will do so lazily by storing the expressions and reducing them only when asked for.
However, the functor and Applicative instances of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access