-
Notifications
You must be signed in to change notification settings - Fork 52
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
Update integer list example #2103
Conversation
* use `swarm format` * use `tydef` * use `format` * use accumulator functions
@byorgey what do you think of the reformatting? 🙂 I think it is pretty good, though it does merge comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks pretty good.
In some sense we don't need this any more since we now have actual lists, but it's still nice as an extended example. Might be nice to add a comment explaining this.
example/list.sw
Outdated
, 1 + snd p | ||
) | ||
} | ||
if (nextPart == 0) {(2 * i, 1 /* last part */)} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the reformatting moved the last part
comment inside some parens...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the comment before the expression, but the formatted inserts an empty line before it.
I guess that is better, but will needs some tweaks if we want to use it for all files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this more, I am actually surprised that it does not print {(2 * i, 1)} /* last part */
. I thought it was supposed to do that; I will have to think about whether this is a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, getting auto-formatted comments to look good in all situations is surprisingly tough. But I would be very happy to collect more examples of where it breaks down to see if we can continue tweaking the output.
swarm format
tydef
format