-
Notifications
You must be signed in to change notification settings - Fork 65
Tutorial: Haddock
PkHutch edited this page Mar 21, 2017
·
3 revisions
Haddock is a documentation generator, which means that if code is written using a certain style of comments, then Haddock can generate user-friendly HTML explaining it, along with various other kinds of documentation files. It's effectively JavaDoc for Haskell.
- Run
stack install haddock
from command prompt, terminal, etc, after switching to the courseography folder.
-
Run
stack exec courseography docs
from command prompt, terminal, etc. -
The resulting documentation should be stored in the
doc
folder, the best overview can be found at theindex.html
file.
It is a bit redundant to include everything, see the Haddock User Guide, so instead the two most useful Haddock practices are included below. A function is done using the following format:
-- |Function description.
function
A module header that doesn't include all possible fields for a module header is done using the following format:
{-|
Module : some_module
Description : Some short description.
A bigger description of some_module, potentially a rant on how there isn't a convention for the tense of your Haddock
comments.
-}