Haddock (software)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Haddock
Developer(s) Simon Marlow
Initial release May 1, 2002
Stable release
2.8.0 / September 2, 2010
Written in Haskell
Operating system Cross-platform
Platform x86, PowerPC
Type 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] Its lightweight markup is based on IDoc's.[3] Haddock is contained in the Haskell Platform.

It is used by the GHC, Gtk2Hs and HTk projects,[4] 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

References[edit]

  1. ^ Haddock runs on POSIX-compliant operating systems and Microsoft Windows.
  2. ^ Section 1.3. Acknowledgements
  3. ^ a b c "Haddock: A Haskell Documentation Tool" -(by Simon Marlow, Proceedings of the ACM SIGPLAN workshop on Haskell, 2002; PDF)
  4. ^ "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.

External links[edit]