Haddock chokes on function arguments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Haddock chokes on function arguments

Arnaud Bailly-2
Hello,
while trying to generate Haddock documentation (Haddock version 2.9.2, (c) Simon Marlow 2006), it chokes on the following fragment

-- |Apply a given function over all elements of a list and select one of the
-- results.
selector :: (Arbitrary b) =>
            [a]      -> -- ^ Elements to select from
            (a -> b) -> -- ^ Constructor to apply to selected element
            Gen b
selector list ctor = oneof (map (return . ctor) list)

with the following error message:

'   parse error on input `-- ^ Elements to select from

I am puzzled as this is exactly how arguments are supposed to be documented, according to http://www.haskell.org/haddock/doc/html/ch03s02.html#id565220

Any clues ?

Arnaud

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haddock chokes on function arguments

Roel van Dijk-3
Does it help if you format it like this:

-- |Apply a given function over all elements of a list and select one of the
-- results.
selector :: (Arbitrary b)
         => [a]       -- ^ Elements to select from
         -> (a -> b)  -- ^ Constructor to apply to selected element
         -> Gen b
selector list ctor = oneof (map (return . ctor) list)

So placing the => and -> before the lines instead of after them?

2011/8/25 Arnaud Bailly <[hidden email]>:

> Hello,
> while trying to generate Haddock documentation (Haddock version 2.9.2, (c)
> Simon Marlow 2006), it chokes on the following fragment
>
> -- |Apply a given function over all elements of a list and select one of the
> -- results.
> selector :: (Arbitrary b) =>
>             [a]      -> -- ^ Elements to select from
>             (a -> b) -> -- ^ Constructor to apply to selected element
>             Gen b
> selector list ctor = oneof (map (return . ctor) list)
>
> with the following error message:
>
> '   parse error on input `-- ^ Elements to select from
>
> I am puzzled as this is exactly how arguments are supposed to be documented,
> according to http://www.haskell.org/haddock/doc/html/ch03s02.html#id565220
>
> Any clues ?
>
> Arnaud
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haddock chokes on function arguments

Arnaud Bailly-2
Yes, it works better. Thanks for fixing my dumbness. But then, why is it documented the other way ?

Regards,
Arnaud

On Thu, Aug 25, 2011 at 4:30 PM, Roel van Dijk <[hidden email]> wrote:
Does it help if you format it like this:

-- |Apply a given function over all elements of a list and select one of the
-- results.
selector :: (Arbitrary b)
        => [a]       -- ^ Elements to select from
        -> (a -> b)  -- ^ Constructor to apply to selected element
        -> Gen b
selector list ctor = oneof (map (return . ctor) list)

So placing the => and -> before the lines instead of after them?

2011/8/25 Arnaud Bailly <[hidden email]>:
> Hello,
> while trying to generate Haddock documentation (Haddock version 2.9.2, (c)
> Simon Marlow 2006), it chokes on the following fragment
>
> -- |Apply a given function over all elements of a list and select one of the
> -- results.
> selector :: (Arbitrary b) =>
>             [a]      -> -- ^ Elements to select from
>             (a -> b) -> -- ^ Constructor to apply to selected element
>             Gen b
> selector list ctor = oneof (map (return . ctor) list)
>
> with the following error message:
>
> '   parse error on input `-- ^ Elements to select from
>
> I am puzzled as this is exactly how arguments are supposed to be documented,
> according to http://www.haskell.org/haddock/doc/html/ch03s02.html#id565220
>
> Any clues ?
>
> Arnaud
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haddock chokes on function arguments

Ozgur Akgun
Hi Arnaud,

On 25 August 2011 15:44, Arnaud Bailly <[hidden email]> wrote:
But then, why is it documented the other way ?

It isn't, as far as I can see. Are we both looking at the same place, namely section 3.2.3?

--
Ozgur Akgun

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haddock chokes on function arguments

Arnaud Bailly-2
OK. Time to go to bed...

Apologies for the noise.

Arnaud

On Thu, Aug 25, 2011 at 4:50 PM, Ozgur Akgun <[hidden email]> wrote:
Hi Arnaud,


On 25 August 2011 15:44, Arnaud Bailly <[hidden email]> wrote:
But then, why is it documented the other way ?

It isn't, as far as I can see. Are we both looking at the same place, namely section 3.2.3?

--
Ozgur Akgun


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe