Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.)



Practically every other language does the same thing. For instance in C would you expect `int x;` to be the same as `intx;`?


No. But I expect this to not be parsed as a single comment:

     /* <stuff> */ <stuff> /* <stuff> */


I 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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: