[Discussion] [RFC-1092] Add support for System.Half #500
Replies: 8 comments 2 replies
-
I think I can answer some:
Currently, My verdict: don't do this.
They were deliberately excluded from the runtime API proposal on the grounds that they require rounding. Since they are not in the explicit conversion operators, implementing it ourselves would undoubtedly lead to differences once the runtime catches up and provides these conversions. My verdict: don't do this.
This may actually lead to us postponing this implementation. I have some ideas how we can do this painlessly without a dependency, but if the past is any indication, this may be considered a blocker. |
Beta Was this translation helpful? Give feedback.
-
I am, thus far, in 100% agreement with @abelbraaksma ... and I’m still “noodling” on the final point (about compatibility with < |
Beta Was this translation helpful? Give feedback.
-
@cartermp Since .NET will continue to evolve and the future will see faster increase of versions and, likely, features, we'll need some way to allow a single I can think of several ways, but each has its drawbacks, here's a little brainstorm:
My preference is the the 3rd option, as, when done right, gives us a lot of freedom in implementing a proper cross-tfm FSharp.Core.dll cherry-picking optimized functions when they become available, and keeping up with new features added in the runtime. It may also be a way forward to start adding the long-awaited |
Beta Was this translation helpful? Give feedback.
-
So this won't happen for at least a year until FSharp.Core targets net5.0+? |
Beta Was this translation helpful? Give feedback.
-
It's my understandng that System.Half can be used directly using the name "System.Half" plus the existing available operators and types |
Beta Was this translation helpful? Give feedback.
-
@Happypig375 I've added a note to the RFC proposal here asking for clarification on the status-quo experience. I really believe it is likely to not be that bad, no worse than consuming any other user-defined C# numeric type from F#. Missing literals and a built-in https://github.com/fsharp/fslang-design/pull/499/files#r501840990 |
Beta Was this translation helpful? Give feedback.
-
Yeah, by now I wonder if we should drop this or not. We do have NS 2.0 and NS 2.1 for F# Core, but I don't see plans for .NET 6.0 or up on the horizon. I know I tried to champion this proposal, unless we find some useful way to support certain future features of .NET in F# Core and the compiler (i.e. literals and sprintf placeholders), I don't quite see this happening. |
Beta Was this translation helpful? Give feedback.
-
There is so much junk here, added at top level. The cost of the junk outweighs the benefits of the feature. Everything is outside of boxes. People will think toddlers have been let loose.
For something extremely common, like System.Double, having a type-alias is OK. Having two type aliases, like For something extremely rare like this, which would be public at the top level, then 0 type aliases is best. Without a type alias you can open
Again never two, and here 0 is best since System.Half already has these functions.
No this is a ludicrous level of junk. Adding nans at top level in F# was a mistake and the existing ones should be hidden (
Again. Should not be taken out of its box. I think we need a cleanup discussion before making progress with this RFC.
Not worth it. If we are going to add another possible letter, there is more valuable in having it user-definable since there is a shortage of letters available for numeric literals. These ones have to be done:
(NB this would be superseded by the generic iequatable/icomparable suggestion).
Probably have to do this. I assume from the existence of both |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This thread is meant to discuss the proposal RFC-1092, see #499.
This follows language suggestion: fsharp/fslang-suggestions#909.
Unresolved questions atm:
half: int -> half
andhalf: decimal -> half
even thoughSystem.Half
does not define them?Beta Was this translation helpful? Give feedback.
All reactions