compact : MorphIndependently (String -> Result error_ Value.IndexOrName) (Value.IndexAndName -> String)
With compact indexes. Use in combination with Value.Morph.eachTag
just before chaining to Value.Morph.json
part
MorphValue
index index in the buildervariant
MorphValue
index in the builderValue.Morph.part
order → breaking changeValue.Morph.part
s → no changeSee also Value.Morph.descriptive
value : MorphOrError Json (Value String) error_
Morph.OneToOne
from a generic representation of an elm value
string : Morph Json String
Morph from a String
Broadens to a compact String
.
To adjust format readability → stringBroadWith
stringBroadWith : { indentation : Basics.Int } -> Morph Json String
Json.string
Morph with adjustable indentation.
This is a bit clunky since stringBroadWith
is using Json.Encode.encode
.
I bet we could make this cleaner with a custom MorphRow
and a nice pretty-printable broad representation like the-sett/elm-pretty-printer
.
Json.Encode.Value
A value from the javascript side:
from a port
,
on init
,
from elm/http
, ...
Compiler magic. Not case
able. Elm crashes on ==
.
Can include functions, proxies, getters, bigInts, anything
and.. of course this can be abused to break elm's promises 🙈, see for example
randomness without Cmd
ellie
jsValueMagic : Morph Json JsValueMagic
Morph to valid Json
value format from JsValueMagic
About json numbers...
Float
as defined in the IEEE 754 standard
which is hardcoded into almost all CPUs.
This standard allows Infinity
and NaN
which the json.org spec does not include.elm/json
silently encodes both as null
.
This behavior matches JSON.stringify
behavior in plain JSDecimal
Decoder
s/Encoder
s can only handle Float
range which dictates the range we can use for Decimal
s