This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Retain highlevel structural information while encoding to JSON
version 1.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-10-25 11:02:00 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

README

json-encode-exploration Build Status

Retain highlevel structural information while encoding to JSON

So this is a bit of an experiment. Rather than encoding straight into a Json.Encode.Value, this encodes to one of three things:

  • Encoded Value
  • Encoded Seq
  • Encoded Obj

Especially the latter 2 are interesting, since it means we can now write and use functions to, for example addField : String -> Encoded a -> Encoded Obj -> Encoded Obj, or 2 concatenate two Encoded Sequences.

There is not destructuring, so once a value is inside an Encoded a, you can no longer reach or manipulate it.

At the end of everything, you can toValue your Encoded thing to get a simple Value.

Made with ❤️ and released under BSD-3.