0

I can successfully generate haddock html files from inside the src directory:

$ cd src && haddock --html Person.hs -o ../docs && cd ../
Haddock coverage: # some parts were omitted for brevity
Warning: Package name is not available.
 100% (  2 /  2) in 'Person'

But when I try to do it from outside the src directory it doesn't work:

$ haddock --html src/Person.hs -o docs 
Haddock coverage:

src/Person.hs:3:1: error:
    Could not find module ‘Address’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import Address
  | ^^^^^^^^^^^^^^

Probably not relevant, but here is Person.hs:

-- | Persons are awesome
module Person where
import Address

-- | I am a nice person living somewhere
data Person = Person { name :: String, address :: Address } deriving ( Show )
OrenIshShalom
  • 5,974
  • 9
  • 37
  • 87
  • 2
    I'd recommend creating a proper Cabal package, and generating the haddocks with `cabal haddock`. – sjakobi Oct 01 '22 at 12:20

0 Answers0