parenthesis around nested lambda functions removed incorrectly
See original GitHub issuePrettier 1.16.4 Playground link
# Options (if any):
Input:
type MakeUpdater = (ids: string[]) => ((proxy: any, response: any) => any);
Output:
type MakeUpdater = (ids: string[]) => (proxy: any, response: any) => any;
Expected behavior: input is not modified; parentheses are preserved around second lambda function to improve readability
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
f# - More instructions in lambda function body - Stack Overflow
F# is whitespace- and indentation-sensitive. Nesting of blocks of code is determined by how they are indented to the right.
Read more >Lambdas, Nested Functions, and Blocks, oh my! | The Pasture
What's in a Name? The rest of the syntax is easy to follow: there's an opening parentheses to start the usual argument list,...
Read more >Overusing lambda expressions in Python - Trey Hunner
Python's lambda expressions allow a function to be created and passed around (often into another function) all in one line of code.
Read more >Lambda Expressions and Functional Interfaces: Tips and Best ...
Lambda syntax only requires parentheses around more than one parameter, or when there is no parameter at all. That's why it's safe to...
Read more >Python Lambda Function - Learn By Example
Learn to create a Lambda function in Python, pass multiple arguments, return multiple values, combine with map() and filter(), sort iterables, nested ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
IMO the input is perfectly readable. It describes a function that returns a function that returns a value.
Isn’t that the same result type, though? Does this break code or is it a stylistic request?