lue-bird/elm-morph/3.0.0

NOTE: the latest version is 3.0.1

Dict.Morph

MorphIndependently
(beforeMapValue -> Result (ErrorWithDeadEnd 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

transform

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" ) ]

Inverse of List.Morph.dict

{ key : MorphValue comparableKey
, value : MorphValue value
}
-> MorphValue (Dict comparableKey value)