Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example formatting is intimidating #87

Closed
timbertson-zd opened this issue Nov 12, 2019 · 4 comments
Closed

Example formatting is intimidating #87

timbertson-zd opened this issue Nov 12, 2019 · 4 comments

Comments

@timbertson-zd
Copy link

Are the examples (e.g. https://github.com/dhall-lang/dhall-kubernetes/blob/master/examples/deploymentSimple.dhall ) auto-formatted somehow? These were very offputting to me as the first example I was exposed to, the indentation makes it really hard to parse and implies much more complexity (nesting) than there actually appears to be.

I manually reformatted as https://gist.github.com/timbertson-zd/accefe1f69fd28c77238e43bc80ac3b2. To my (unfamiliar) eyes it looks much more approachable.

@ari-becker
Copy link
Collaborator

Are the examples (e.g. https://github.com/dhall-lang/dhall-kubernetes/blob/master/examples/deploymentSimple.dhall ) auto-formatted somehow? These were very offputting to me as the first example I was exposed to, the indentation makes it really hard to parse and implies much more complexity (nesting) than there actually appears to be.

I manually reformatted as https://gist.github.com/timbertson-zd/accefe1f69fd28c77238e43bc80ac3b2. To my (unfamiliar) eyes it looks much more approachable.

The Dhall (Haskell) executable has a formatter which establishes a standard formatting for the language (similar to go fmt or terraform fmt). People don't have to use it, but it helps for shared work, as all auto-formatters do. Hand-formatting will, strictly speaking, almost always get you a nicer result, at the expense of occasional mistakes, trying to persuade other people you work with to take the time to format nicely, etc.

For what it's worth, I also found the standard formatting jarring when I first started writing Dhall - I got used to it over time, and now the standardization makes standard-formatted code easier to read for me.

@Gabriella439
Copy link
Contributor

I think it's important to note here that once dhall-kubernetes merges this:

#84

... the examples get nicer by using the record completion operator. See this for example:

https://github.com/dhall-lang/dhall-kubernetes/blob/4ef46543ceff0e10978cca542952c56ee6e47b93/examples/aws-iam-authenticator-chart.dhall

@craig-day
Copy link

yeah... the schemas will look so much nicer once we can do record completion. So much so, that I'm actually referencing the commit from #84 in my files and it killed every usage of merging // and cleaned up the schemas a ton.

@timbertson-zd
Copy link
Author

Thanks @Gabriel439, sounds like that'll improve things dramatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants