Haddock (software)

From Wikipedia, the free encyclopedia

Haddock
Developed by Simon Marlow
Initial release May 1, 2002
Latest release 2.0.0.0 / January 8, 2008
Written in Haskell
OS Cross-platform
Genre Documentation generation
License BSD-style license
Website http://haskell.org/haddock/

Haddock is a free, portable[1] command-line program documentation generator for Haskell. It is influenced by IDoc [1], HDoc [2], and Doxygen.[2] It produces hyperlinked HTML files from annotated Haskell (the documentation is embedded in comments) source files, with additional information extracted from type annotations; it supports only partially generating documentation in SGML[3]. It is often used in conjunction with darcs and Cabal. It is dependent on GHC, using a modified form of the HsParser (written in Happy) parser for Haskell included in GHC[3] and does not accept literate Haskell source code.[4] Its lightweight markup is based on IDoc's[3]. The entire implementation is approximately 2200 lines of code[3].

It is used by the GHC, Gtk2Hs and HTk projects[5], as well as XMonad and Yi.

Here is an example of Haddock markup:

-- | This is the documentation for 'square', which uses the (*) operator from "Prelude". It multiplies the @x@ argument against itself.
square :: Integer -> Integer
square x = x*x

[edit] References

  1. ^ Haddock runs on POSIX-compliant operating systems and Microsoft Windows.
  2. ^ 1.3. Acknowledgements
  3. ^ a b c d "Haddock: A Haskell Documentation Tool" -(by Simon Marlow, Proceedings of the ACM SIGPLAN workshop on Haskell, 2002; PDF)
  4. ^ "Haddock only accepts plain, non-literate, Haskell source. This means that if you program in Literate Haskell, or you need to use the C pre-processor in your Haskell source, then you need to pre-process the files before feeding them to Haddock." From "Chapter 2. Invoking Haddock"
  5. ^ "Haddock is being used to document the new hierarchical Haskell libraries. The documentation generated for the libraries shipped with the latest release of GHC is here. The Gtk2Hs project is using Haddock to build reference documentation. The HTk project is using Haddock to generate its library documentation." From the Haddock homepage.

[edit] External links

Languages