3 ms·
It 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
by TheLoneWolfling 12y ago
It 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...