Comment Syntax
Creighton Hogg
wchogg at primula.hep.wisc.edu
Wed Feb 1 21:26:26 EST 2006
On Thu, 2 Feb 2006, Henrik Nilsson wrote:
> Hi all,
>
> To corroborate Wadler's law further.
>
> Josef wrote:
>
> > Oh yes, it does happen that a single line comment begins with a
> > special symbol. It has happened to me on several occations when using
> > haddock annotation to my source code. It is all to easy to forget that
> > extra space. With incomprehensible error messages as a result.
>
> But might that not just mean that the error messages ought to be
> improved?
>
> I don't know how hard that would be, but after having played around
> a bit with GHC, the messages I get are either of the type
> "parse error on input '--|'" or of the type "Not in scope: `-->'"
> (followed by lots of other stuff not being in scope etc).
>
> If this really is a big problem for beginners, it would not seem
> totally infeasible to add some special code that helpfully suggests
> that a space perhaps ought to be inserted?
>
> Or have you seen significantly worse error messages?
Well, if anecdotal evidence from a real live beginner would
help, I've never had problems with the comments.
I think I made that mistake once, looked at the line it
failed on, and added the space.
More information about the Haskell-prime
mailing list