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:
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
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
Encoded thing to get a simple
Made with ❤️ and released under BSD-3.