Comments (2)
Glad you brought this up, though function application in patterns, where there's more than one argument, is pretty rare. More often this is coded to accept a tuple. But that's besides the point you're trying to make.
Isn't your first example invalid code? You have this in the list code: [ name speed flyTime restTime ]
, but in the follow-up, you have the equivalent of [ name; speed; flyTime; restTime ]
. Which really are two different things.
Those offset rules are a bit worrying though.
TBH: my vote would probably be for leaving it on one line. That's probably gonna be controversial (isn't everything related to formatting?).
But then again, that pairs pretty badly with a multiline list, seq or array construction.
Hmm, I recant that idea. To be in line with the other function application rules, aligning them like your first example appears most sensible, tbh. But any which way I look at it, it's hard to think of any formatting that would improve the readability of such code...
from fslang-design.
I would say we should split like in the first example.
Related, patterns do seem to have some funky offset rules from time to time.
This seems like a bug and I can see it makes the splitting hard to implement.
from fslang-design.
Related Issues (20)
- [style-guide] Units of measure should format like expressions HOT 7
- [style-guide] Guidance for code quotations HOT 1
- [style-guide] when expressions in match clauses HOT 15
- [style-guide] Format mutation expressions on their own line HOT 11
- [style-guide] Formatting of argument lists HOT 27
- [style-guide] Presence of shebangs in scripts HOT 8
- [style-guide] prefer leading rather than trailing operators HOT 8
- [style-guide] Chain of (fluent) calls HOT 7
- [style-guide] Multiline base constructor call HOT 2
- [style-guide] Stroustrup bracket style HOT 28
- [style-guide] Multiline type annotations HOT 5
- [style-guide] Advice on Attributes needs improving HOT 1
- [style-guide] Parameter owner patterns should be consistent with prefix application expressions HOT 10
- [style-guide] Breaking of complex pattern match expressions HOT 1
- [style-guide] Lambda closing paren defaults HOT 5
- [style-guide] Treat cast operators :> and :?> as pipe operators
- Bug: Compilation error when multiple interface generic types are matched using `or`.
- [style-guide]: Multiline generic type parameters bracket alignment HOT 3
- [style-guide] Single case union with private constructor and static members HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fslang-design.