Conversions of char->decimal, string->nativeint, and string->unativeint
let a = char 48m // Sure
let b = decimal a // error FS0001: The type 'char' does not support a conversion to the type 'decimal'
let c = LanguagePrimitives.ExplicitDynamic<string, nativeint> "2" // Works although warning FS1204: This function is for use by dynamic invocations of F# code and should not be used directly
let d = nativeint "2" // error FS0001: The type 'string' does not support a conversion to the type 'nativeint'
let e = LanguagePrimitives.ExplicitDynamic<string, unativeint> "2" // Works although warning FS1204: This function is for use by dynamic invocations of F# code and should not be used directly
let f = unativeint "2" // error FS0001: The type 'string' does not support a conversion to the type 'unativeint'
I propose we stop being inconsistent and add these 3 conversions.
The existing way of approaching this problem in F# is #nowarn "1204", or having to write conversion functions by ourselves.
Pros and Cons
The advantages of making this adjustment to F# are
- Consistency
- Convenience
- Conciseness
The disadvantages of making this adjustment to F# are that (insert the reason for specifically excluding these 3 conversions as written in https://github.com/dotnet/fsharp/blob/954210d1e8590b708801b2e9f70717f09979b9c0/src/fsharp/ConstraintSolver.fs#L1448-L1451).
Extra information
Estimated cost (XS, S, M, L, XL, XXL): XS
Related suggestions: #1030 - Subtraction of two chars
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
Conversions of char->decimal, string->nativeint, and string->unativeint
I propose we stop being inconsistent and add these 3 conversions.
The existing way of approaching this problem in F# is
#nowarn "1204", or having to write conversion functions by ourselves.Pros and Cons
The advantages of making this adjustment to F# are
The disadvantages of making this adjustment to F# are that (insert the reason for specifically excluding these 3 conversions as written in https://github.com/dotnet/fsharp/blob/954210d1e8590b708801b2e9f70717f09979b9c0/src/fsharp/ConstraintSolver.fs#L1448-L1451).
Extra information
Estimated cost (XS, S, M, L, XL, XXL): XS
Related suggestions: #1030 - Subtraction of two chars
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.