Why is there no documentation for haddock?

My Haskell file (pretty sure this isn't a problem) is basically:

import System.IO
...

-- | Every Word is a String
type Word = String

...

-- | Some documentation for Haddock to see
main :: IO ()
main = do
        ...

      

My Setup.hs

:

import Distribution.Simple
main = defaultMain

      

My grade.cabal

:

name:                grade
version:             0.1.0.0
...
build-type:          Simple
cabal-version:       >=1.8

executable grade
  main-is:             grade.hs
  -- other-modules:       
  build-depends:       base ==4.6.*, split ==0.2.*
  hs-source-dirs:      src

      

When I run cabal haddock --executables

I get

...
Haddock coverage:
Warning: Not found in environment: Main.main
  50% (  1 /  2) in 'Main'
Warning: Main: could not find link destinations for:
    Main.main
Documentation created: dist/doc/html/grade/grade/index.html

      

while HTML contains main

but no documentation for it. It doesn't even contain the functions I defined except main

. Why is this?

+3


source to share


1 answer


You need to add a module declaration to create documents for it.



module Main (main, Word) where

      

+6


source







All Articles