<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
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.<br>
<br>
I hope that helps,<br>
<br>
Nikita<br>
<br>
[1] <a class="moz-txt-link-freetext" href="http://www.haskell.org/haddock/doc/html/ch03s03.html">http://www.haskell.org/haddock/doc/html/ch03s03.html</a><br>
<br>
On 19/03/13 07:41, Christopher Howard wrote:<br>
</div>
<blockquote cite="mid:51480893.30505@frigidcode.com" type="cite">
<pre wrap="">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
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/beginners">http://www.haskell.org/mailman/listinfo/beginners</a>
</pre>
</blockquote>
<br>
</body>
</html>