Support for Unicode Mathematical Symbols (∪, ∩, ∈) as Infix Operators in F# #823
Replies: 2 comments 5 replies
-
|
I’d love to hear the community’s thoughts on this proposal. Do you see value in allowing Unicode mathematical symbols as infix operators? What other symbols would you consider essential for mathematical or scientific programming? Are there technical challenges or parsing concerns that you think should be addressed early? Please share examples, scenarios, or even counterpoints — the more perspectives we gather, the stronger this suggestion can become. |
Beta Was this translation helpful? Give feedback.
-
|
My personal opinion is that anything which is hard to type on common ANSI/ISO keyboards makes user experience worse, including allowing optional use, because you know people will abuse it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the F# compiler does not allow Unicode mathematical symbols to be used as infix operators. This limits expressiveness and productivity both at the high school level and in professional work, as well as in academic scenarios, especially in set theory.
Proposal: Allow symbols such as ∪, ∩, ∈ to be recognized as infix operators, just like +, -, *.
Expected Impact:
1)Anyone who completed high school would feel more attracted to programming.
2)Unification between Mathematics and Programming Language.
3)Simplicity in code writing and reading.
4)Faster writing .
5)Expansion of the F# language itself, making it more expressive and accessible.
Example:
fsharp
// Today
let C = Set.union A B
let D = Set.intersect A B
let ok = Set.contains 3 A
// Proposed
let inline ( ∪ ) A B = Set.union A B
let inline ( ∩ ) a b = Set.intersect a b
let inline ( ∈ ) x set = Set.contains x set
let C = A ∪ B
let D = A ∩ B
let ok = 3 ∈ A
This change could bring mathematics even closer to programming and open doors to new audiences.
Beta Was this translation helpful? Give feedback.
All reactions