-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Avoid extra parens for wildcard type signature #2764
Conversation
Could you add some tests for the examples you give in the PR description? |
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.
LGTM modulo adding some tests.
@michaelpj there are now tests for the tuple, list and unit type. 🙂 |
+ avoid parens in simple cases (a, Char, [a], (),...) - change one test - (Int)/Int
(circleci did not finish so I rebased on master to give it a second chance) |
[ "func :: _" | ||
, "func x y = x + y" | ||
] | ||
[ "func :: (Integer -> Integer -> Integer)" |
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.
Hmmm, I guess it's not easy to tell if the hole is the entirety of the type signature? That seems like the remaining slightly bad case, and also probably a relatively common one...
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.
Anyway, that can be future work.
Thanks for this! |
+ avoid parens in simple cases (a, Char, [a], (),...) - change one test - (Int)/Int Co-authored-by: Ondrej Sebek <[email protected]>
A followup to haskell#2764
This is a followup to haskell#2764.
This is a followup to haskell#2764.
* Omit more parens for wildcard type signature (haskell#2929) This is a followup to haskell#2764. * Review suggestions
Avoid parentheses in simple cases (
a
,Char
,()
,...).The good news is, that getting types inside tuples and lists will not force you to apply hint "Redundant brackets":
The caveat is that it is still context unaware (works on text only) and the common use case of
f :: _
is not improved.