3 ms·
Author seems unaware that ..- might be parsed as a single operator, seems "not mathematical" to her. A good illustration how beginners in any language get hung
by warmfuzzykitten 12y ago
Author seems unaware that ..- might be parsed as a single operator, seems "not mathematical" to her. A good illustration how beginners in any language get hung up on small things that are different than other languages they know.
- TheLoneWolfling 12y agoIt seems like a flaw in Haskell's parser to me. It looks like it is doing basic greedy tokenizing before passing it on to the parser, and, as this shows, that is not the best fit in this case. Syntactically significant whitespace is seldom a good thing. (With the potential exception of indentation.)
- TheCoelacanth 12y agoPractically every other language does the same thing. For instance in C would you expect `int x;` to be the same as `intx;`?
- TheLoneWolfling 12y agoNo. But I expect this to not be parsed as a single comment: /* <stuff> */ <stuff> /* <stuff> */
- kluge 12y agoI think it's just normal tokenizing. `..-` is a legal name for an operator. An error is given since no operator of that name is in scope. The alternative of this getting parsed as a range operator and a negative number now and changing to an application of `..-` if that is ever defined or imported doesn't sound very good...