-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Add mathematical/arrows unicode operator support #283
base: master
Are you sure you want to change the base?
RFC: Add mathematical/arrows unicode operator support #283
Conversation
e1912b8
to
74f97cc
Compare
c938889
to
19c46fa
Compare
I know some people are keen on this sort of thing (I'm occasionally asked about it). Usually the reasoning is about wanting to make the code look more like the maths that's being modelled. It's a reasonable thing to want, although not something that Idris is generally targetted towards. So, I'm going to have to think about what has changed since the FAQ entry you refer to. I think it's right to revisit the issue, but I would still like to be careful. The bug fix is definitely necessary - thanks for spotting that! Could it be in a PR on its own instead, though? There are two things I'd definitely require:
I'm also a bit worried about what will happen to external library code, but I'd hope some reasonable conventions would emerge based on what the standard libraries do, and based on needing a flag to enable support. |
Ah yes, the minor unicode identifier fixes are on #290, I forgot to put that in the PR description. |
19c46fa
to
16c3efc
Compare
16c3efc
to
923489e
Compare
My 2 cents: As a software developer, the mathematical notation is puzzling -- there is no standard for that representation, and it is quite usual that math papers start by defining the notation that will be used in the rest of the paper. So I think that it is fine that packages would choose to use a mathematical notation, using Unicode symbol or names, with the possibility of renaming names from the Prelude and Base packages as Unicode names and symbols. But to build on what Edwin said, I would forbid to use any Unicode name or symbol in the Prelude and Base, e.g. by adding a flag in the package ipkg that permits to verify this when parsed. Then there would be the issue of the implication and equality symbols. Here I would define a directive to alias these, such as they could be renamed on a package per package basis. |
5c3e150
to
f816000
Compare
As a side note: Scala allowed Unicode operators, but deprecated and now forbid them. The problem is that if person A starts with Unicode, but person B working on the same code cannot easily type them, you get a mix of both which is not nice. |
136d3cd
to
1db3aca
Compare
1db3aca
to
e4245d4
Compare
e4245d4
to
9f961f1
Compare
Major change:
From a commit in this repo:
Though from Idris 1 FAQ [2013]:
This doesn't allow any arbitrary unicode, it adds the following 2 blocks:
This is a work in progress. I want to add a pragma or compiler option to enable this (So that this extra operators are opt-in) however since there is the possibility that unicode operators (even non-arbitrary) aren't desirable I would leave this as currently is for people to evaluate before implementing flags/pragmas to control this feature.