elm-ast
elm-ast copied to clipboard
AST printer?
Thanks for writing this! I think this will be very useful for an idea I have for converting GraphQL schemas to Elm code. However one key thing that seems to be missing is an AST printer. Is that planned? If not I can try to come up with something.
What do you mean when you say AST printer? A pretty printer? If so, something like that isn't planned and it would be a welcome contribution, but I'd urge you to wait until after Elm 0.18 comes out as I'm likely going to make some significant changes to support positional information in the AST after it does.
Basically a function that would take in any Elm AST record and output a string of Elm code. An AST by itself is good for introspection, but a printer is needed to make building/modifying ASTs useful. Some things that would be possible with an Elm AST parser + printer:
- Rewriting
elm-format
in Elm (@avh4, thoughts?) - Converting a GraphQL introspection query into Elm code