[Haskell-cafe] Comment Syntax

Guy guytsalmaves-h at yahoo.com
Tue Jun 7 11:36:35 CEST 2011


On 07/06/2011 10:55, Ivan Lazar Miljenovic wrote:
> On 7 June 2011 17:50, Guy<guytsalmaves-h at yahoo.com>  wrote:
>> On 07/06/2011 10:45, Ivan Lazar Miljenovic wrote:
>>>
>>> On 7 June 2011 17:41, Guy<guytsalmaves-h at yahoo.com>    wrote:
>>>> I originally posted because I found that --| stood out much more clearly
>>>> as
>>>> a structured comment than -- |.
>>>
>>> How does a missing space character make that stand out any more? :/
>>>
>>> (Admittedly, I rely more on emacs using a different colour for Haddock
>>> comments than non-Haddock comments.)
>>
>> Try it without emacs :-)
>
> I've also read un-highlighted Haskell code; I don't see "--|" standing
> out any more than "-- |" does.  My guess is that you just get used to
> it...
>
> Another argument against special-casing "--|": what happens if you
> want to use a _different_ documentation generator (I don't know why
> you would, but someone might) than Haddock, which uses a different
> markup identifier?

Out of interest, is there any other language where the comment delimiter is invalid if immediately followed by a symbol?

Haskell seems to be parsing -- as if it was an operator (hence other legal lexemes could mean something else). Other 
languages say "stop parsing here", so the comment delimiter can be followed by anything. (I could, of course, be 
completely wrong there.)





More information about the Haskell-Cafe mailing list