HTML Haskell CSS TypeScript JavaScript TeX Other
Switch branches/tags
Clone or download
harpocrates and RyanGlScott Avoid line breaks due to line length in Hoogle (#868)
* Avoid line breaks due to line length in Hoogle

Hoogle operates in a line-oriented fashion, so we should avoid ever
breaking due to long lines.

One way of doing this non-intrusively is to modify the 'DynFlags' that
are threaded through the 'Hoogle' module (note this is anyways only
passed through for use in the various 'showSDoc' functions).

* Amend test case
Latest commit 657b1b3 Jul 6, 2018
Failed to load latest commit information.
doc Add grid table example to cheatsheet Feb 1, 2018
driver-test The Haddock part for fully gcc-like response files Jan 2, 2016
driver The Haddock part for fully gcc-like response files Jan 2, 2016
haddock-api Avoid line breaks due to line length in Hoogle (#868) Jul 6, 2018
haddock-library Bump a few dependency bounds (#845) Jun 5, 2018
haddock-test haddock-test: Be more explicit which packages to pass Mar 2, 2018
hoogle-test Avoid line breaks due to line length in Hoogle (#868) Jul 6, 2018
html-test Use `ClassOpSig` instead of `TypeSig` for class methods (#835) May 23, 2018
hypsrc-test Improve hyperlinker's 'spanToNewline' (#846) Jun 5, 2018
latex-test Fix test failures on Windows (#564) Jul 3, 2017
scripts Move dist scripts to scripts/ Apr 11, 2017
.arcconfig Add an .arcconfig file. Dec 12, 2014
.arclint Add .arclint file. Dec 12, 2014
.ghci Move sources under haddock-api/src Aug 23, 2014
.gitignore Fix #548 by rendering datatype kinds more carefully (#702) Feb 1, 2018
.travis.yml Drop GHC HEAD from CI and update GHC to 8.4.3 Jun 20, 2018 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 Mar 27, 2018
CONTRIBUTING CONTRIBUTING file for issues Sep 3, 2014
LICENSE Move Haddock API to a separate package Aug 22, 2014
Makefile Update Makefile for the new GHC build system Jul 5, 2009 README updates (#856) Jun 30, 2018
STYLE Add a pointer to the style guide Oct 17, 2010
Setup.lhs Fix Setup.lhs Oct 15, 2012
cabal.project Add haddock to cabal.project Apr 11, 2017 Drop Paths_haddock from (#707) Nov 20, 2017
haddock.cabal Replace 'attoparsec' with 'parsec' (#799) Apr 25, 2018
haddock.wrapper GHC build system: Make *nix installation work in paths containing spaces Nov 5, 2009

Haddock, a Haskell Documentation Tool Build Status

About haddock

See Description on Hackage.

Source code documentation

Full documentation can be found in the doc/ subdirectory, in reStructedText format format.

Project overview

This project consists of three packages:

  • haddock
  • haddock-api
  • haddock-library


The haddock package provides the haddock executable. It is implemented as a tiny wrapper around haddock-api's Documentation.Haddock.haddock function.


haddock-api contains the program logic of the haddock tool. The haddocks for the Documentation.Haddock module offer a good overview of haddock-api's functionality.


haddock-library is concerned with the parsing and processing of the Haddock markup language.


Please create issues when you have any problems and pull requests if you have some code.


To get started you'll need a latest GHC release installed.

Clone the repository:

  git clone
  cd haddock

and then proceed using your favourite build tool.

Using cabal new-build

cabal new-build -w ghc-8.4.1
# build & run the test suite
cabal new-test -w ghc-8.4.1 all

Using Cabal sandboxes

cabal sandbox init
cabal sandbox add-source haddock-library
cabal sandbox add-source haddock-api
cabal sandbox add-source haddock-test
# adjust -j to the number of cores you want to use
cabal install -j4 --dependencies-only --enable-tests
cabal configure --enable-tests
cabal build -j4
# run the test suite
export HADDOCK_PATH="dist/build/haddock/haddock"
cabal test

Using Stack

stack init
stack install
# run the test suite
export HADDOCK_PATH="$HOME/.local/bin/haddock"
stack test

Git Branches

If you're a GHC developer and want to update Haddock to work with your changes, you should be working on ghc-head branch. See instructions at for an example workflow.

Updating html-test

When accepting any changes in the output of html-test, it is important to use the --haddock-path option. For example:

cabal new-run -- html-test --haddock-path $(find dist-newstyle/ -executable -type f -name haddock) --accept