-
Notifications
You must be signed in to change notification settings - Fork 271
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
Colonectomy #118
Colonectomy #118
Conversation
I think that's unlikely. You'd need much bigger pressure than that, otherwise I suspect use of the |
Does promoting the list cons constructor (i.e. |
How often does the use of |
It confuses people that come from Elm. I'm +1 on this, provided the promoted list cons constructor changes as well. |
We implemented the single-colon convention in ermine, which otherwise adhered very closely to haskell syntax. In that case I came to the conclusion that the payoff wasn't worth the cost, which came from A) context-switching between syntactic conventions, and B) having existing code snippets we wished to borrow and use fail to compile without a bit of extra work C) syntax-highlighting etc. for Haskell not working as well and directly with ermine files. You might say: "well, that cost seems minor." Sure. But the payoff was minor too, and in my experience, even more minor. |
Thanks everyone for the comments. I'd like to mostly remove myself from the discussion as my own opinion should be clear, but I will address particular points. |
Another cost to be considered is that all printed resources would have to be updated as well. This would probably confuse newcomers to no end, since all their material (initially at least) would be wrong. I still think having the option to use NCC on a per-file basis would be nice, especially if one is coming from ML or Agda. |
@Tritlo A simple and clear compiler error that explains the change in meaning of the symbols would probably be sufficient to solve that cost. I don't see it being too big of a problem. |
I oppose the proposal. I am certainly sympathetic to the view that Haskell got this one wrong. But I think this will lead to far too much confusion, especially for new users. |
I am fully in support of this proposal. I was skeptical initially, bu what swayed me was the reference to analogous decisions made in C, and the quote from Kernighan and Ritchie. I am am looking forward to more proposals inspired by C. I am aware that some people will have trouble adjusting to the new visual appearance. The proposal should recommend using a “legacy mode” font in their editor, that displays the unicode character “'U+003A COLON” as While we are at it: |
If we break every single Haskell source file, it better be For Great Good. This doesn't qualify, IMO.
Let's not forget PureScript. I'm curious how the total population of
Generally speaking, the extension Syntactically speaking foo
:: Monad m
=> Int
-> Double
-> m Char The keen observer might ask, |
I just noticed that this prerequisite is not true. I recommend the original author to first ensure that Isabelle and Agda switches to NCC first; then we can follow. |
@nomeata Thanks I didn't know about Isabelle, but you are right. Of course it's an old language, but still in use. However Agda follows the NCC as noted in the document. In a previous comment I noted that Purescript and Frege also follow Haskell's convention. I was going to save this until tomorrow, since maybe no one will believe what I say today, but I want to reiterate that this is actually a serious proposal. I posted it on April Fool's Day because otherwise I feared no one would take it seriously! If there's an April Fool's Joke then it's a twist--the proposal in a way seems so outlandish that it should be a joke, but in fact it is not, and although I'm gratified most people are taking it seriously I'm a bit sad that some people were "fooled". Anyway I'd like to continue the serious discussion going forward. Perhaps it is too much to hope that Haskell will evolve to following the NCC, but the less ambitious goal is to give people a choice, and if there really is enough passion to change things then crowdsourcing should move us closer. I understand the counterargument of confusion, and perhaps that's enough to scuttle the proposal, but I don't believe a per-file flag should be confusing (no more than any other extension which changes or enriches the syntax), and certainly no existing code will be broken so the change is absolutely safe. |
@Tritlo Another cost to be considered is that all printed resources would have to be updated as well. We are already envisaging that: doing away with @parsonsmatt mentions I'd draw attention to the proposal for tight-binding EDIT: I've never liked the syntax for FunDeps. This
looks like we're applying
What's even more annoying is that
|
TypeScript and Scala are |
@AntC2 I actually would be in favor of rolling up a list of "Big Breaking Changes" which we'd implement all at once. Stuff like a more sensible Prelude, a reasonable/native A |
`\/` for `forall` seems quite awful for those who use QWERTY w.r.t pinky
keystrokes. Also, `,` would probably be better for reasons @nomeata
mentioned. The two-space thing is a good point.
About confusing newcomers - I'm not sure a per-module language extension
could confuse a newcomer. It's also possible Haddocks could still treat ":"
as "::" for doc-rendering, no?
…On Sun, Apr 1, 2018, 8:42 PM Matt Parsons ***@***.***> wrote:
@AntC2 <https://github.com/AntC2> I actually would be in favor of rolling
up a list of "Big Breaking Changes" which we'd implement all at once. Stuff
like a more sensible Prelude, a reasonable/native String type, turning on
all of PureScript's extensions by default, and maybe even syntactic changes
like this would be cool.
A sed script could be distributed that would do most of the tedious work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#118 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARyL64etOWlEYirmbs_ETRshUSnS5-5nks5tkXQAgaJpZM4TCzgq>
.
|
I'm against this proposal as causing much upheaval for little gain. Of course I'd rather have just one colon (though having |
One of the things I love about the Haskell community is it's propensity to improve on the "good enough" when a "better" appears. AFAICT most of those opposing this proposal agree that Regarding newcomer confusion, this would stem mainly from the current Haskell literature using As for the costs of migrating current codebases to a new syntax, it doesn't seem as something a sed script couldn't handle. I might be wrong, but for me (and maybe I'm being too much of an idealist) legacy code has never been a compelling reason for not improving something. At the very least, I'm glad this discussion is taking place, and hope that if we can all agree that some change to the language would be better, we take steps in that direction. |
It is now April 2nd AoE, and this proposal is still open, so let me give a non-April-1st response: To me, this proposal clearly does not pull the weight and complexity that it entails. It’d be like telling the English to start using The only way I could see this happening in Haskell is some hypothetical pragma But on its own – thanks for asking, but no. |
Since @goldfirere and @nomeata are against the proposal and are on the committee I suppose there is no hope, but again let me say that the proposal was serious, and I disagree with the objections "expensive" and "weight and complexity". As I tried to point out in the proposal, adding an extension to allow users to reverse the colon convention on a per-file basis is extremely simple to do and also safe. I suppose the point is that Haskell already has enough extensions, and adding one more, even if simple and straightforward, just to fix a syntactic flaw is not justified. I do agree it would potentially add confusion in the short term (and perhaps for quite a while), and perhaps that alone is enough to reject it. I well know the failure of attempts at uniformization, having grown up in the 70s when US schools tried to teach the metric system (the fatal flaw there was that you were never taught to think in metric, rather only how to mechanically convert between the two systems). Still I'm ever the optimist, and I do think it's worth trying to push for a much simpler change in something we have control over. If "colonectomy" can be bundled with a larger set of improvements in the future, I'm all for it. |
I like the idea of a slew of opt-in breaking syntactic changes in conjunction with dependent Haskell in preparation for a Haskell 2025 that will also include language levels. I think each constituent change should also get its own extension. Yes, this is goofy, but I hope it kicks us down the slippery slope of rethinking old uninteresting warts with the language. And don't forget that Rust is NCC too. |
I'm in full agreement with @nomeata's point about a raft of changes all at once. I almost wrote that myself, but decided not to. And, by "full agreement", I mean that I fully agree with the comment there about "yes, maybe" -- I'm fully open to the idea of possibly supporting such a thing. |
April 1st turned out to be really bad timing for this proposal. I couldn't tell that certain comments were jokes. |
April 1st was the only acceptable timing for this proposal imo. |
Indeed. My comment above was on the basis it was still April 1st in Glasgow/GMT (I forgot about daylight saving); and that @halfaya was engaged in some sort of double-bluff. Like all spoofs, it had to have some sort of credibility in order to 'bite'. And it was an opportunity to vent/bikeshed about my least-favourite bits of syntax. If anybody took me seriously, I apologise and (in any case) withdraw. |
This could be implemented as a preprocessor, so we wouldn't need an extension (for now) and even older ghcs could use it. |
Unlike seemingly most others here, I like the fact that we have |
I have to chime in with @ivan-m here. In addition, I'm very happy to have single-character list deconstruction. (And construction, but that's really the lesser concern.) |
What does annoy me about list deconstruction is that you use
How about
IOW
|
That's an interesting idea. I'm somewhere around +0.75 on it... I'm nervous that One case that it may not be able to handle, which I actually wrote earlier this week while prototyping an idea: xyzs@(x:xs@(y:ys@(z:zs))) |
Fair point. Note even in H98 you can write multiple as-patterns for the same component like
And there's an extension about to land for pattern synonyms that allows more than a bare name to the left of
Then this would follow that logic (just unwind from the inside out):
The presence of the comma followed by EDIT: added 'comma followed by' above in response to @tejon below. This should be valid, and is probably a more common use case than tejon's monster, and reads smoothly:
The rule is: inside |
instance Enum a => Enum [a] where
fromEnum = fromEnum . head
toEnum n = [toEnum n ..]
foo = [[0..] ..]
bar = join . drop 3 $ foo
baz = take 2 bar
-- bar = [4, 5] I may or may not have cried a little while verifying that this works, but legal is legal. |
You should be arraigned for cruelty to lists ;-) I think that's not a counter-example. (There's no We should both be arraigned for hijacking @halfaya's proposal. |
I'm opposed to this proposal. The benefit it brings are very low and arguably subjective, the cost OTOH is extremely high. Even as an opt-in extension, I am still skeptical it would be really used in practice. |
I've always thought Haskell had too much syntax, but removing a single colon isn't quite what I meant. |
Thing have become quiet here. @halfaya, do you still want to go forward with this or can we close it? |
It sounds like there is no hope of it succeeding, so go ahead and close it. |
Ok. Nevertheless, thanks for your contribution! (Most of my proposals don't get submitted either :-)) |
Remove one colon from the
::
in type signatures. A serious proposal.Rendered