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
How to deal with spaces inside of parens #7
Comments
|
I think the best way to resolve this is to try some different options. |
Since we need to pick one to start, I'd say let's start with "spaces if there are commas," in other words: ( foo, bar )
(foo bar)
(foo == bar) ...or perhaps more precisely "spaces if there could be commas," so in other words: import Foo exposing ( bar )
import Bar exposing ( baz, qux ) I've never tried that style with imports, but at first glance I like how it looks! |
Okay, let's try @rtfeldman's most recent suggestion and see how it looks on real examples. |
Another possibility could be: no spaces if the parens are within a single line, spaces if they span multiple lines, so: module Foo (a, b) where
module Foo
( a
, b
) where
(foo == bar)
( foo
== bar
)
(foo, bar)
( foo
, bar
) |
I could see that, although I'd still keep the spaces for tuples in order to be consistent with the spaces lists and records have. I do like tuples with spaces and function application without, because it helps distinguish the two in a more identifiable way at a glance than a tiny comma. |
Will implement #20 for now. |
Parens are used in many different ways. Should the same rule apply to all? What should the rules be?
The text was updated successfully, but these errors were encountered: