Re: [Haskell-cafe] error on --++ bla bla bla

2009-10-01 Thread Ketil Malde
Hong Yang hyang...@gmail.com writes: But in my program, I did not define --++. And that's what the error tells you, no? Defining operators (or not) doesn't change the syntax. Since the lexeme --++ is syntactially a valid operator, it will be parsed as such, regardless of whether it is defined

[Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Hong Yang
Hi, I got an error if one of lines reads --++ bla bla bla where I tried to comment, but -- ++ bla bla bla (notice the space after --) is OK. Do you think this revealed a tiny bug in the GHC compiler (I am using Windows Haskell Platform 2009.2.0.2)? Thanks, Hong

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Daniel Peebles
I don't think it's a bug. --++ is a valid operator, whereas -- introduces a comment. In GHCI: Prelude let (--++) = (+) in 5 --++ 6 11 Hope this helps, Dan On Wed, Sep 30, 2009 at 7:52 PM, Hong Yang hyang...@gmail.com wrote: Hi, I got an error if one of lines reads --++ bla bla bla where I

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Sebastian Sylvan
On Thu, Oct 1, 2009 at 12:52 AM, Hong Yang hyang...@gmail.com wrote: Hi, I got an error if one of lines reads --++ bla bla bla where I tried to comment, but -- ++ bla bla bla (notice the space after --) is OK. Do you think this revealed a tiny bug in the GHC compiler (I am using Windows

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Hong Yang
But in my program, I did not define --++. Also in GHCI, Prelude :t (--++) No in scope: '--++' Prelude :t (+) (+) :: (Num a) = a - a - a Thanks, Hong On Wed, Sep 30, 2009 at 7:05 PM, Daniel Peebles pumpkin...@gmail.comwrote: I don't think it's a bug. --++ is a valid operator, whereas --

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Hong Yang
Nowhere any Haskell book mentioned line comments start with -- , not just --. It is just people usually put -- ahead of comments. I can successfully compile --print bla bla bla. On Wed, Sep 30, 2009 at 7:36 PM, Sebastian Sylvan sebastian.syl...@gmail.com wrote: On Thu, Oct 1, 2009 at

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Alexander Dunlap
Comments are started with -- followed by a character that is not a symbol character. If it is followed by a symbol character (e.g. *) then the -- plus the symbol (e.g. --*) parses as an operator rather than a comment. p is not a symbol, so the -- starts a comment. For a precise description of

Re: [Haskell-cafe] error on --++ bla bla bla

2009-09-30 Thread Alexander Dunlap
Oops...forgot the footnote. The lexical syntax part of the report is at http://haskell.org/onlinereport/lexemes.html. Alex On Wed, Sep 30, 2009 at 7:56 PM, Alexander Dunlap alexander.dun...@gmail.com wrote: Comments are started with -- followed by a character that is not a symbol character. If