You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PkHutch edited this page Mar 21, 2017
·
3 revisions
About
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.
Installation
Run stack install haddock from command prompt, terminal, etc, after switching to the courseography folder.
Generation
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 the index.html file.
Comment-Style
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.
-}