Ticket #197 (closed defect: duplicate)

Opened 2 years ago

Last modified 23 months ago

Haddock chokes when no main module is given using lhs and cabal.

Reported by: timthelion Owned by:
Priority: minor Milestone:
Version: 2.9.4 Keywords:
Cc:

Description

dcoutts told me to make a ticket for this.

$ ghc --version

The Glorious Glasgow Haskell Compilation System, version 7.4.1

$ haddock --version

Haddock version 2.10.0, (c) Simon Marlow 2006 Ported to use the GHC API by David Waern 2006-2008

$ cabal haddock --executables

Running Haddock for Lit-1.0... Preprocessing executable 'helloworld' for Lit-1.0...

dist/build/tmp-5960/lit.hs:5:1: parse error on input `main'

$ haddock lit.lhs -h

Haddock coverage:

0% ( 0 / 2) in 'Main'

Warning: Main: could not find link destinations for:

GHC.Types.IO


name: Lit version: 1.0 cabal-version: >= 1.2 Build-Type: Simple

Executable helloworld

Main-Is: lit.lhs


| Hi there!

\begin{code}

main = print "Hello World!"

\end{code}


-- | Hi there

main = print "Hello World!"

Attachments

lit.cabal (122 bytes) - added by timthelion 2 years ago.
lit.lhs (73 bytes) - added by timthelion 2 years ago.

Change History

Changed 2 years ago by timthelion

Changed 2 years ago by timthelion

Changed 2 years ago by duncan

Note that the .cabal and .lhs files are not needed to reproduce the problem, simply the lit.hs file like this:

-- | Hi there

main = print "Hello World!" 

fails with error:

lit.hs:3:1: parse error on input `main'

If you add a module Main where to the top then it works fine.

In case it matters, full command line was:

haddock  --dump-interface=dist/doc/html/Lit/helloworld/Lit.haddock --optghc=-package-name --optghc=Lit-1.0 --verbosity=1 --html --odir=dist/doc/html/Lit/helloworld --title=helloworld --optghc=-hide-all-packages --optghc=-fbuilding-cabal-package --optghc=-i --optghc=-idist/build --optghc=-i. --optghc=-idist/build/autogen --optghc=-Idist/build/autogen --optghc=-Idist/build --optghc=-optP-include --optghc=-optPdist/build/autogen/cabal_macros.h --optghc=-odir --optghc=dist/build --optghc=-hidir --optghc=dist/build --optghc=-stubdir --optghc=dist/build --optghc=-O --optghc=-XHaskell98 --optghc=-odir --optghc=dist/build/tmp-27089 --optghc=-hidir --optghc=dist/build/tmp-27089 --optghc=-stubdir --optghc=dist/build/tmp-27089 -B/usr/local/lib/ghc-7.0.4 lit.hs --optghc=-package --optghc=base

Changed 2 years ago by anonymous

  • milestone 2.10.0 deleted

Milestone 2.10.0 deleted

Changed 23 months ago by SimonHengel

  • status changed from new to closed
  • resolution set to duplicate

This is a duplicate of #10.

Duncan, thanks for the example. I added it to the description of the original ticket.

Note: See TracTickets for help on using tickets.