Skip to content

:doc command does not work on ghc boot libraries with ghc-8.6.4

In the GHC 8.6.4, GHCi's :doc command does not work on ghc boot libraries, such as GHC.Base.
Perhaps boot libraries of GHC 8.6.4 were compiled without the -haddock option.

At least, it occurs in linux and windows binaries of GHC 8.6.4:

The error messages are as follows:

ghci> :doc id
ghc: Can't find any documentation for GHC.Base.
This is probably because the module was compiled without '-haddock',
but it's also possible that the module contains no documentation.

Try re-compiling with '-haddock'.
ghci> import Control.Monad.State
ghci> :doc State
ghc: Can't find any documentation for Control.Monad.Trans.State.Lazy.
This is probably because the module was compiled without '-haddock',
but it's also possible that the module contains no documentation.

Try re-compiling with '-haddock'.

Previous version of GHCi (ghc 8.6.3) could perform :doc command as follows.

ghci> :doc id
 Identity function.

 > id x = x
ghci> import Control.Monad.State
ghci> :doc State
 A state monad parameterized by the type @s@ of the state to carry.

 The 'return' function leaves the state unchanged, while @>>=@ uses
 the final state of the first computation as the initial state of
 the second.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information