Skip to main content

Maps

Given the following Scala Map:

val myMap = Map("foo" -> 123, "bar" -> 456)

and the equivalent Morphir/ELM dictionary:

myMap: Dict String Int
myMap = Dict.fromList
[
("foo", 123),
("bar", 456)
]

This data should be represented in the Morphir data-model as the following:

Data.Map(
values = Map(
Data.String("foo") -> Data.Int(123),
Data.String("bar") -> Data.Int(456),
)
shape = Concept.Map(keyType = Concept,String, valueType = Concept.Int)
)