-
Notifications
You must be signed in to change notification settings - Fork 143
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
RFC FS-1148 - Ease conversion between Units of Measure (UoM) and undecorated numerals and simplify casting #784
base: main
Are you sure you want to change the base?
Conversation
- `ResizeArray` | ||
- `Seq` | ||
|
||
Total added methods is 195 `13 supported primitives * 3 methods * (primitive + 4 collection types)`. They are presented as 15 methods with 13 overloads each. |
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.
This is my personal concern - it's a lot of new surface area and probably a bunch of sigdata, optdata and il.
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.
Incremental size is around 31KB which translates to roughly 163 bytes per method. I don't really have a have a sense of whether that is acceptable or not. If the majority of F# users aren't making extensive use of UoM then there's no sense in making them carry around any extra weight.
The part of the feature that I sense would answer the most questions for users is removal of units from primitives. If I can call LanguagePrimitives.FloatWithMeasure
, I'd expect the inverse LanguagePrimitives.FloatWithoutMeasure
, although the same effect is currently available with the existing primitive conversion methods like float
.
Maybe the collections are better off in a FSharp.Collections.Units
or as an addition to FSharp.UMX
that has an essentially identical API using overloaded methods for primitives extended to non-numeric types?
In general, currently, I believe that in this form (method per type per action, etc) it should live in a separate library (be part of UMX)? However, I generally think that this particular functionality (add, strip measure) can and should be solved generically (i.e. we should have one type directed generic function |
Based on Don's comments
I took "complex" to mean something I wouldn't be capable of as a novice contributor. Do you have a sense of how complex and pervasive such an addition would be? |
Click “Files changed” → “⋯” → “View file” for the rendered RFC.