haskell / haskell/cabal

`cabal new-haddock` produces no documentation for single module executables

Open
#5,890 5 comments 1 reaction 0 assignees View on GitHub
attention: needs-help cabal-install: cmd/haddock type: bug type: regression
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

With the following .cabal file (and any Main.hs),
```
name: nodoc
version: 0
build-type: Simple
cabal-version: >= 1.2

executable nodoc
main-is: Main.hs
other-modules:
build-depends: base
```
no documentation is produced by `cabal new-haddock --haddock-executables`. As soon as one adds at least one module to the `other-modules` specification, documentation is generated, including the Main module.
```
$ cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library
$ haddock --version
Haddock version 2.20.0, (c) Simon Marlow 2006
Ported to use the GHC API by David Waern 2006-2008
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.4.2
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.