Small Haddock question

View: New views
2 Messages — Rating Filter:   Alert me  

Small Haddock question

by Andrew Coppin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is irritating me now... Suppose I have something like the following:

zero = 0 :: Int
one = 1 :: Int
two = 2 :: Int
three = 3 :: Int

How do I add Haddock comments to the end of each line? For some reason,
Haddock doesn't like either of

zero = 0 :: Int -- | Zero
zero = 0 :: Int -- ^ Zero

Either way it whinges about parse errors. How do I make it shut up and
stop being so dense at me? :-} It's damned obvious what I want it to do...


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Small Haddock question

by Denis Bueno :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jul 4, 2009 at 08:22, Andrew Coppin<andrewcoppin@...> wrote:

> This is irritating me now... Suppose I have something like the following:
>
> zero = 0 :: Int
> one = 1 :: Int
> two = 2 :: Int
> three = 3 :: Int
>
> How do I add Haddock comments to the end of each line? For some reason,
> Haddock doesn't like either of
>
> zero = 0 :: Int -- | Zero
> zero = 0 :: Int -- ^ Zero
>
> Either way it whinges about parse errors. How do I make it shut up and stop
> being so dense at me? :-} It's damned obvious what I want it to do...

I think top-level definitions can only be commented in one way:

    -- | Emptiness and void, as an Int.
    zero = 0 :: Int


                              Denis
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe