Haddock is a documentation generator for Haskell
Questions tagged [haddock]
129 questions
6
votes
2 answers
Haddock: Document a declaration with inferred type signature?
Consider the following module
{-# LANGUAGE RecordWildCards #-}
module Example (foo, fuh, fon, fuzz) where
import qualified FirstClassModule (Bar(foo,fuh,fon,fuzz), makeBar)
FirstClassModule.Bar {..} = FirstClassModule.makeBar parameter
parameter…

Heinrich Apfelmus
- 11,034
- 1
- 39
- 67
6
votes
1 answer
What does * (star) or other kinds mean in an instance list of haddock
Browsing the haddocks of various packages I often come along instance documentations that look like this (Control.Category):
Category k (Coercion k)
Category * (->)
or this (Control.Monad.Trans.Identity):
MonadTrans (IdentityT *)
What exactly here…

Julia Path
- 2,356
- 15
- 21
6
votes
2 answers
Where does 'stack haddock' place the docs it generates?
Where does stack haddock (or stack build --haddock) place the documentation that it generates?

orome
- 45,163
- 57
- 202
- 418
6
votes
1 answer
haddock "could not find link destinations for"
I tried using haddock to generate documentation for a library and while it works, it won't link any types that are part of GHC/the standard libraries and emits this error:
Warning: The documentation for the following packages are not installed.…

tolUene
- 572
- 3
- 18
6
votes
1 answer
How do I use Haddock with c2hs?
I am using c2hs to write some haskell
bindings, and I would like to use Haddock
to document automatically generated constructors and function parameters. However,
c2hs ignores the comments;
{#enum define WinPos
{
CA as HA -- ^ This comment is…

HaskellElephant
- 9,819
- 4
- 38
- 67
6
votes
1 answer
Haddock - link to function in external module (whole module imported)
Suppose I have a Haskell module named MyModule that imports an external module like this:
import ModuleA hiding (a, b, c)
And I cannot modify this import statement, because the program is not exactly mine.
I wish to link to…

yanhan
- 3,507
- 3
- 28
- 38
6
votes
2 answers
Haddock link to functions in non-imported modules
In module B I have documentation with a link 'A.foo', linking to the foo member of module A. In module A I import module B. Haddock renders this as a link to A.html#t:foo, namely pointing at the type foo (which does not exist) not the function foo,…

Neil Mitchell
- 9,090
- 1
- 27
- 85
6
votes
1 answer
Haddock: Documentation for instance functions with quirks replaced by default class documentation
Consider the following example:
instance (Monad m) => MonadState s (ChronoT s e m) where
-- | Returns the present-day state.
get = ChronoT $ do
(ChronoS _ s _) <- get
return s
-- | Set the present-day state directly,…

kvanbere
- 3,289
- 3
- 27
- 52
5
votes
0 answers
How to force new line inside a table in Haddock (Haskell)
I need to make some documentation with a table that has a cell with two lines (It's code, so it needs to be on separated lines). However if I try
{-
+----------+------------------+
| Col1 | Col2 |
…

Santiago Cuellar
- 385
- 1
- 6
5
votes
0 answers
Can I generate a "fully exposed" and "normal" version of Haddock docs without recompiling?
I am using Haddock (w/ Stack) to generate documentation for a software suite I'm working on. I would like to generate 2 variants of the Haddock docs; one normally (e.g., vanilla stack haddock), and one with fully exposed modules (e.g., stack haddock…

Jason
- 51
- 1
5
votes
1 answer
How to exclude dependencies when building haddocks?
Is there any way to build haddock docs for specific packages? I'm trying to build haddocks for my package/app alone, but the following command seems to be doing this for all dependencies, as well:
stack haddock webservice
(where webservice is the…

Saurabh Nanda
- 6,373
- 5
- 31
- 60
5
votes
1 answer
How to view Haskell's documentation using Haddock?
For example, how would I view the docs for Data.List.group as I could on hackage?
If I try to use Haddock as:
$ haddock Data.List
: error: module ‘Data.List’ is a package module
$ haddock…

xrisk
- 3,790
- 22
- 45
5
votes
1 answer
How do I incorporate a blank line into a Haddock example?
Haddock supports blank lines, and supports REPL examples. But I can't figure out how to show a blank line in an example.
For example, if 'f' prints out two lines separated by a blank line
ghci> f
Line1
Line 2
The corresponding Haddock example
--…

orome
- 45,163
- 57
- 202
- 418
5
votes
0 answers
Haddock: imported class instances are not documented
Due to mutually dependent imports I had to move the class instances in an Instances module and my datatypes in a Types module. The definitions of both two modules are then re-exported by the main module of the package.
Haddock lists for my type the…

Rnhmjoj
- 863
- 1
- 10
- 18
5
votes
1 answer
How to get Cabal Sandbox to install correctly linked HTML documentation?
I created a cabal library inside a sandbox with the following commands:
cabal sandbox init
cabal init
I added the line documentation: True to cabal.config to make sure that documentation is generated, and I added a dependency to the vector package…
user1002430