I propose we Allow the use of colon : in all custom operators.
Since the inclusion of dotnet/fsharp#15923 the : operator has been permitted only when the first non-ignored operator character is >.
I discovered this while working on updating the spec document resulting in this discussion. fsharp/fslang-spec#68
Pros and Cons
The advantages of making this adjustment to F# are it will simplify the lexing rules to allow : anywhere.
Currently the rules allow >: ?.>: or ><+-*/=~%.&|@^!?: but not <: or +:.
Existing uses of : specialized as keyword operators like : :?> :? :> :: := would be unaffected. A slight modification to this proposal would keep : as the first character of an operator reserved for type-related or other special operations in the compiler since that's what it tends to be used for today.
The disadvantages of making this adjustment to F# are operators containing : won't be able to be used for special purposes in the compiler in the future but there are no active plans to do this dotnet/fsharp#15923 (comment)
Extra information
Estimated cost (XS, S, M, L, XL, XXL): XS
Related suggestions: N/A
Affidavit (please submit!)
Please tick these items 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.
I propose we Allow the use of colon
:in all custom operators.Since the inclusion of dotnet/fsharp#15923 the
:operator has been permitted only when the first non-ignored operator character is>.I discovered this while working on updating the spec document resulting in this discussion. fsharp/fslang-spec#68
Pros and Cons
The advantages of making this adjustment to F# are it will simplify the lexing rules to allow
:anywhere.Currently the rules allow
>:?.>:or><+-*/=~%.&|@^!?:but not<:or+:.Existing uses of
:specialized as keyword operators like: :?> :? :> :: :=would be unaffected. A slight modification to this proposal would keep:as the first character of an operator reserved for type-related or other special operations in the compiler since that's what it tends to be used for today.The disadvantages of making this adjustment to F# are operators containing
:won't be able to be used for special purposes in the compiler in the future but there are no active plans to do this dotnet/fsharp#15923 (comment)Extra information
Estimated cost (XS, S, M, L, XL, XXL): XS
Related suggestions: N/A
Affidavit (please submit!)
Please tick these items 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.