Morph
for an elm/core
Dict key value
eachValue : MorphIndependently (beforeMapValue -> Result (Morph.ErrorWithDeadEnd Basics.Never) mappedValue) (beforeUnmapValue -> unmappedValue) -> MorphIndependently (Dict narrowKey beforeMapValue -> Result error_ (Dict narrowKey mappedValue)) (Dict broadKey beforeUnmapValue -> Dict broadKey unmappedValue)
Morph.OneToOne
each value in a Dict key value
list : MorphIndependently (List { key : comparableNarrowKey, value : narrowValue } -> Result error_ (Dict comparableNarrowKey narrowValue)) (Dict broadKey broadValue -> List { key : broadKey, value : broadValue })
Morph.OneToOne
from a List { key : key, value : value }
to a Dict key value
.
import Dict
import Morph
[ { key = "git", value = "gud" }
, { key = "Hi", value = "there" }
]
|> Morph.mapTo Dict.Morph.list
--> Dict.fromList [ ( "Hi", "there" ), ( "git", "gud" ) ]
value : { key : Value.Morph.Internal.MorphValue comparableKey, value : Value.Morph.Internal.MorphValue value } -> Value.Morph.Internal.MorphValue (Dict comparableKey value)
Dict
MorphValue