I suggest you ...

Allow Unicode symbols to be used as operators

It would be great to define mathematical operators (e.g. ∀, ∑, ∩) in F#, and be able to use other Unicode symbols (such as arrows) in operators as well. So instead of saying

let inline (!++) xs = xs |> Seq.sum

you could say

let inline (~∑) xs = xs |> Seq.sum

Writing "∑myList" is much, much easier on the eyes and brain than trying to figure out what "!++myList" does.

92 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Yusuf MotaraYusuf Motara shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    12 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • RickasaurusRickasaurus commented  ·   ·  Flag as inappropriate

        I've got a modern APL Keyboard (you can order them from UNICOMP with USB) and I'd love to have this feature.

      • Gustavo GuerraGustavo Guerra commented  ·   ·  Flag as inappropriate

        It's not hard to type. You set up the greek keyboard on control panel and then and set a global hotkey like Ctrl+Alt+Shift to switch from/to it, then the ∑ is just the capital S, and similar for other symbols

      • Finn NeuikFinn Neuik commented  ·   ·  Flag as inappropriate

        I've been learning a little Haskell recently and something I like about the emacs mode is that it'll do a conversion on the fly between standard keywords and unicode representations. For example typing -> results in emacs showing →. It's nice seeing things like composition, nil, etc appearing 'correctly' and you easily add more. The source code itself remains with the standard characters. It'd be great to see something similar in F# (or rather Visual Studio) as I find it sometimes makes code a little opaque when you have to chase definitions of operators. The only issue with the emacs mode is that it messes with the whitespace (e.g. forall and . ∀ , use a different number of characters) but I'm guessing that could be worked out.

      • Daniel JacksonDaniel Jackson commented  ·   ·  Flag as inappropriate

        With much improved intellisense, typing these operators might not be as big of an issue. <sarcasm>Alternatively, you could try and convince your employer to provide and gift you an "Optimus Maximus" keyboard.</sarcasm>

      • Yusuf MotaraYusuf Motara commented  ·   ·  Flag as inappropriate

        It's a bit annoying on Windows, since you have to set it up by editing a registry value and rebooting (see http://en.wikipedia.org/wiki/Alt_code).

        Then to type ∑, you turn on NumLock, hold down Alt, then press the following keys in turn: U, Numpad-Plus, 2, 2, 1, 1. (2211 is the Unicode character ∑; it can be typed either on the top-row of numbers or on the numpad). You can find more mathematical symbols here: http://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode

      • SealedSunSealedSun commented  ·   ·  Flag as inappropriate

        That's a cool idea, but how do you type these characters? I'm using the macro keys on my Logitech G15 (1st gen) keyboard, but I find it far from ideal.

      Feedback and Knowledge Base