Logo

Programming-Idioms

History of Idiom 8 > diff from v45 to v46

Edit summary for version 46 by schuelermine:
[Haskell] Added import

Version 45

2018-12-30, 11:42:43

Version 46

2019-06-07, 10:26:12

Idiom #8 Initialize a new map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Idiom #8 Initialize a new map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Extra Keywords
table dictionary hash
Extra Keywords
table dictionary hash
Imports
Imports
import Data.Map.Strict
Code
x = Data.Map.Strict.fromList [ ("red", "FF0000"), ("blue", "0000FF") ]

Code
x = Data.Map.Strict.fromList [ ("red", "FF0000"), ("blue", "0000FF") ]

Doc URL
http://hackage.haskell.org/package/containers/docs/Data-Map-Strict.html
Doc URL
http://hackage.haskell.org/package/containers/docs/Data-Map-Strict.html