Search code examples
haskellghcighcup

GHCi cannot find documentations


I installed Haskell on Windows using ghcup. While using GHCi, ":doc name" answers back with an error message. Some examples are:

ghci> :doc (++) ghc-9.2.5.exe: 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> :doc Sum ghc-9.2.5.exe: Can't find any documentation for Data.Semigroup.Internal. 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'.


Any ideas how to fix this?


Solution

  • The binary distributions (“bindists”) of GHC 9.2.5, and several earlier versions, were missing support for :doc. I believe this was fixed in 9.2.6, since it’s mentioned in the GHC 9.2.6 release notes. You should be able to run ghcup install ghc 9.2 to get the latest 9.2 patch release (currently 9.2.7).

    I happened to notice that it started working on my macOS machine (for the first time!) when I updated to 9.4.2.