Hi,

I believe, the module containing the function summation needs a header. If I add a header, the parse error disappears. This problem may be explained by [1], where the description probably implies that there is a module header.

I hope that helps,

Nikita

[1] http://www.haskell.org/haddock/doc/html/ch03s03.html

On 19/03/13 07:41, Christopher Howard wrote:
Hi. I tried to run haddock on a file with this content:

code:
--------
{-|
  The 'summation' function provides the same function as summation or sigma
  notation. The first argument the starting index number. The second
argument
  is the ending index number. The third argument is a function representing
  the formula for each term.
 -}
summation :: (Eq a, Num a1, Num a) => a -> a -> (a -> a1) -> a1
summation i n f | i == n = f i
                | otherwise = f i + summation (i + 1) n f

...snip...
--------

And I get

quote:
--------
$ haddock summation.hs

summation.hs:7:1: parse error on input `summation'
--------

What is wrong with it? (The code runs fine with GHC.)

$ haddock --version
Haddock version 2.10.0, (c) Simon Marlow 2006
Ported to use the GHC API by David Waern 2006-2008

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1




_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners