lue-bird / elm-morph / Json.Morph

Morph JSON

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

See also Value.Morph.descriptive

value : MorphOrError Json (Value String) error_

Morph.OneToOne from a generic representation of an elm value

Inverse of Value.Morph.json

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.


type alias JsValueMagic =
Json.Encode.Value

A value from the javascript side: from a port, on init, from elm/http, ...

Compiler magic. Not caseable. 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...