Haddock (software)
Encyclopedia
Haddock is a free
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

, portable command-line program documentation generator
Documentation generator
A documentation generator is a programming tool that generates documentation intended for programmers or end users , or both, from a set of specially commented source code files, and in some cases, binary files....

 for Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

. It is influenced by IDoc
Idoc
IDoc, short for Intermediate Document, is a SAP document format for transferring the data for a business transaction.IDoc is similar to XML in purpose, but differs in syntax...

 http://www.cse.unsw.edu.au/~chak/haskell/idoc/doc/install.html, HDoc http://www.fmi.uni-passau.de/~groessli/hdoc/, and Doxygen
Doxygen
Doxygen is a documentation generator for multiple programming languages.Doxygen is a tool for writing software reference documentation. The documentation is written within code, and is thus relatively easy to keep up to date...

. It produces hyperlink
Hyperlink
In computing, a hyperlink is a reference to data that the reader can directly follow, or that is followed automatically. A hyperlink points to a whole document or to a specific element within a document. Hypertext is text with hyperlinks...

ed HTML
HTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....

 files from annotated Haskell (the documentation is embedded in comments
Comment (computer programming)
In computer programming, a comment is a programming language construct used to embed programmer-readable annotations in the source code of a computer program. Those annotations are potentially significant to programmers but typically ignorable to compilers and interpreters. Comments are usually...

) source files
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

, with additional information extracted from type annotation
Type signature
In computer science, a type signature or type annotation defines the inputs and outputs for a function, subroutine or method. A type signature includes at least the function name and the number of its arguments...

s; it supports only partially generating documentation in SGML. It is often used in conjunction with darcs
Darcs
Darcs is a distributed revision control system created by David Roundy; it was designed to replace traditional, centralized source control systems such as CVS and Subversion...

 and Cabal
Cabal (software)
The Haskell Cabal is the Common Architecture for Building Applications and Libraries; it aids in the packaging and distribution of software packages...

. It is dependent on GHC
Glasgow Haskell Compiler
The Glorious Glasgow Haskell Compilation System, more commonly known as the Glasgow Haskell Compiler or GHC, is an open source native code compiler for the functional programming language Haskell. The lead developers are Simon Peyton Jones and Simon Marlow...

, using a modified form of the HsParser (written in Happy
Happy (software)
Happy is a parser generator written in Haskell. It produces haskell-code and optionally optimized code for Glasgow Haskell Compiler and it's extensions. Happy is contained in the Haskell Platform. It is available for Unix-like systems, such as Mac OS X, Linux and BSDish systems and Windows....

) parser for Haskell included in GHC. Its lightweight markup is based on IDoc's. The entire implementation is approximately 2200 lines of code. Haddock is contained in the Haskell Platform
Haskell Platform
The Haskell Platform is a collection of software-packages, tools and libraries, which is to create a common platform for using and developing applications in Haskell. With the Haskell Platform, Haskell follows the same principle as Python: "Batteries included"...

.

It is used by the GHC, Gtk2Hs and HTk projects, as well as XMonad
Xmonad
xmonad is a tiling window manager for the X Window System, written in the functional programming language Haskell.Begun in March 2007, it is similar to dwm, larswm, StumpWM and other members of the tiling window manager family, in that it arranges windows in a nonoverlapping tiled pattern and...

 and Yi
Yi (editor)
Yi is a text editor written and extensible in Haskell. The goal of Yi is to provide a flexible, powerful and correct editor core dynamically scriptable in Haskell....

.

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

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK