-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow vertical pipelines #10
Comments
Been wondering what the best way of handling this is.
normalize lst =
lst |> List.indexedMap Tuple.pair
normalize lst =
lst
|> List.indexedMap Tuple.pair
|> List.sortBy Tuple.second
-- This would still be allowed on 1 line, since it is short.
a |> c |> d |> d |
I personally almost always go vertical, but some folks get really annoyed by line count, so I suspect option #1 or #2 would be more popular. Option #5 is my favorite, which is something like |
Implementation details... a little bit complex since its not just the outermost level, want to apply it all the way down a pipeline too. |
You could do it on a per-line basis too. (It's somewhat painful for hand-written code, but folks could add their own helpers to the extent that they're even building this kind of code manually.)
|
The reason this is tricky to implement at the code generator API level, is that this builds on top of So to have an option in the code generator API for the user to choose if pipes are broken or not, means I need to store something in the DSL to instruct the pretty printer on how to print it. To implement this, I need to make a copy of I could do this quite easily by just copying its codebase but not exposing it to get to the starting point. Would then work from there to figure out what parts of it should be exposed. Would probably change the |
@Akopella On slack expressed a preference for option 1. Its a good idea to implement this flag, even if other solutuions are available, as it could override them. Some coding standards like to strictly enfore vertical pipes. |
I would be nice to format code like this:
If there's already a way to generate code in that format, feel free to close, obviously.
The text was updated successfully, but these errors were encountered: