Generic, case-able elm value
json encoders/decoders are pretty low-level which makes them mildly unpleasant for serialization, explicitly describing how to serialize individual data types. Data that has same shape could at the low level be coded differently, which means you have to spell it out explicitly each time.
Switching to a different format would also be a lot of work; some low-level primitives like bools might not be supported etc.
This module has all the types and operations for these generic Values
while Value.Morph and most other modules contain morphs to convert your types.
An elm literal (that doesn't itself contain other values)
elm structure that can itself contain values
Other kinds of structures should be converted to one of these. A tuple for example can be represented as a record.
Note: To not have overly complex recursive-ish types,
a Value.Composed can describe an invalid elm value,
for example
List [ Unit (), String "huh" ]The structure of a record which can hold multiple tagged field values
Describe the type of Atom
Describe the type of Composed
Only its name identifies the variant or field
Only its index identifies the variant or field
Used as the narrow argument of a MorphValue
Used as the broad result of a MorphValue
Reduce the amount of tag information of the Value
Either
If the AtomOrComposed is a Composed,
change in a given way
If the AtomOrComposed is a Composed,
change in a given way
bundsol/: Boxedtricycle/elm-storage: Storage.ValueValue variantsandre-dietrich/elm-genericthe-sett/decode-genericminiBill/elm-codecMartinSStewart/elm-serializeBytesfujiy/elm-json-convertprozacchiwawa/elm-json-codec
Generic representation of any value representable in elm
Use the
MorphValues present in mostmodules of this package to convert aValue.