Haddock (software)

{{Short description|Command-line program documentation generator for Haskell}}

{{primary sources|date=September 2018}}

{{Infobox Software

| name = Haddock

| screenshot =

| caption =

| author =

| developer = Simon Marlow

| released = May 1, 2002

| latest release version = {{wikidata|property|edit|reference|P348}}

| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}}

| latest preview version =

| latest preview date =

| operating system = Cross-platform

| platform = x86, PowerPC

| programming language = Haskell

| genre = Documentation generation

| license = BSD-style license

| website = http://haskell.org/haddock/

}}

Haddock is a free, portableHaddock runs on POSIX-compliant operating systems and Microsoft Windows. command-line program documentation generator for Haskell.

Software

It is influenced by IDoc,{{cite web|url=http://www.cse.unsw.edu.au/~chak/haskell/idoc/doc/install.html|title=IDoc Manual - Installation|website=www.cse.unsw.edu.au}} HDoc,{{cite web|url=http://www.fmi.uni-passau.de/~groessli/hdoc/|title=Homepage of Armin Größlinger|website=www.fmi.uni-passau.de}} and Doxygen.{{cite web|url=http://haskell.org/haddock/doc/html/ch01s03.html|title=1.3. Contributors|website=haskell.org}} 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. It is often used in conjunction with darcs and Cabal. It is dependent on Glasgow Haskell Compiler (GHC), using a modified form of the HsParser (written in Happy) parser for Haskell included in GHC. Its lightweight markup is based on IDoc's.[http://www.haskell.org/~simonmar/papers/haddock.pdf "Haddock: A Haskell Documentation Tool"] {{Webarchive|url=https://web.archive.org/web/20061011011648/http://www.haskell.org/~simonmar/papers/haddock.pdf |date=2006-10-11 }} -(by Simon Marlow, Proceedings of the ACM SIGPLAN workshop on Haskell, 2002; PDF) Haddock is contained in the Haskell Platform.

It is used by the GHC, Gtk2Hs and HTk projects,"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 [http://haskell.org/haddock/ homepage]. as well as xmonad.{{citation needed|date=April 2019}}

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

{{Reflist}}