NOTE: this package moved to elm/core
NOTE: this package is not compatible with Elm 0.19.1
Library for turning Elm values into Json values.
Convert a Value into a prettified string. The first argument specifies the amount of indentation in the resulting string.
Value
person = object [ ("name", string "Tom") , ("age", int 42) ] compact = encode 0 person -- {"name":"Tom","age":42} readable = encode 4 person -- { -- "name": "Tom", -- "age": 42 -- }
Represents a JavaScript value.
Encode a Float. Infinity and NaN are encoded as null.
Infinity
NaN
null
Convert a
Valueinto a prettified string. The first argument specifies the amount of indentation in the resulting string.