More readable output
Hello,
Is it possible to produce more readable output? It would be great to have these improvements:
- no redundant brackets
- space before colon in type definition
- (=>) used in encoder instead of (,)
- 'val' replaced by one letter variable like 'o'
- import Json.Encode as E, Json.Decode as D and Json.Helpers as H
- use (|:) from Json.Decode.Extra instead of 'andThen' and chained lambda
That certainly is possible but some points, especially the part about removing redundant brackets, will result in a lot of work.
I toyed with the idea of directly generating Elm's AST and pretty printing it in the end, but while it seemed a lot cleaner, I also felt it would be a ton of work.
Finally, the last point would incur an additional dependency. It would probably be simpler to add it to the json-helpers package.
I'll keep that in mind when I'll work again on the package (it still requires proper aeson 11 support), but pull requests would be very welcome :)
It's too bad that the elm compiler is not published on hackage anymore otherwise we could just use that ast and pretty printer...
Oh I didn't realize this wasn't even an option :(
See https://github.com/elm-lang/elm-compiler/issues/1300