Technology:
Haddock
Headline
A documentation generator for Language:Haskell
Illustration
Haddock relies on module headers and simple comment conventions to generate documentation from Haskell source code. Consider, for example, the following module:
{- | This comment is placed before the module header and thus
is seen as the general description of the module. Since
the general description may be a bit longer, it is quite
common to see a multi-line comment in this position. -}
module Main (
foo
) where
-- | The "|" character in the comment expresses that this
-- comment should contribute to the generated documentation.
-- Haddock does indeed search for such comments.
-- We note that 'foo' is indeed exported and thus it
-- deserves documentation. We could also use a multi-line
-- comment of course.
foo :: () -> ()
foo = id
-- This function is not exported.
-- Thus, no Haddock comment is needed.
-- That is, the function will not appear in generated documentation.
bar :: () -> Bool
bar = const True
It uses Haddock comment conventions for the module description and the exported function foo. Haddock supports much more conventions and features; see the documentation. Haddock also nicely integrates with Technology:Cabal such that one can simply invoke "cabal haddock" to generate documentation for a given Haskell package.
There are no revisions for this page.
User contributions
User edits
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.