
I'm just noticing that "--" comments don't seem to work properly when the first character following them is a '*'. Michael --*I like asterisks --*I like asterisks --*I like asterisks --*I like asterisks double x = x+x Prelude> :l double [1 of 1] Compiling Main ( double.hs, interpreted ) double.hs:1:0: parse error on input `--*' Failed, modules loaded: none. Prelude>

let (--*) = (+) in 5 --* 6
===> 11
The comment is introduced by -- followed by a non-symbol (because if
followed by a symbol, it might be an operator)
Hope this helps!
Dan
On Fri, Dec 11, 2009 at 11:30 PM, michael rice
I'm just noticing that "--" comments don't seem to work properly when the first character following them is a '*'.
Michael
--*I like asterisks --*I like asterisks --*I like asterisks --*I like asterisks
double x = x+x
Prelude> :l double [1 of 1] Compiling Main ( double.hs, interpreted )
double.hs:1:0: parse error on input `--*' Failed, modules loaded: none. Prelude>
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Cool! Didn't know that, and the Haskell syntax I looked up made no mention of it.
Thanks,
Michael
--- On Fri, 12/11/09, Daniel Peebles

On Dec 11, 2009, at 23:30 , michael rice wrote:
I'm just noticing that "--" comments don't seem to work properly when the first character following them is a '*'.
I believe the spec only treats "-- " as a comment leader; this is why Haddock markup has a space between the "--" and the markup. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

I'd seen Haddock occasionally mentioned in posts but hadn't gotten to it yet. Looks interesting.
Thanks,
Michael
--- On Fri, 12/11/09, Brandon S. Allbery KF8NH

On Sat, Dec 12, 2009 at 5:34 AM, Brandon S. Allbery KF8NH
On Dec 11, 2009, at 23:30 , michael rice wrote:
I'm just noticing that "--" comments don't seem to work properly when the first character following them is a '*'.
I believe the spec only treats "-- " as a comment leader; this is why Haddock markup has a space between the "--" and the markup.
The spec [1] treats anything that starts with two or more dashes not followed by a non-symbol to be the start of a comment. [1] http://www.haskell.org/onlinereport/syntax-iso.html
participants (4)
-
Brandon S. Allbery KF8NH
-
Daniel Peebles
-
michael rice
-
Raynor Vliegendhart