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 -- }
Convert a
Valueinto a prettified string. The first argument specifies the amount of indentation in the resulting string.