ghc-imported-from: Find the Haddock documentation for a symbol.

[ bsd3, development, library, program ] [ Propose Tags ]

Given a Haskell module and symbol, determine the URL to the Haddock documentation for that symbol.

[Skip to Readme]
Versions [faq],,,,,,,,,,,,,,,,,,,,,
Dependencies base (==4.6.*), Cabal, containers (==, directory, filepath, ghc (==7.6.*), ghc-mod, ghc-paths (==0.1.*), ghc-syb-utils, mtl, process, safe, syb (==0.4.*), transformers [details]
License BSD-3-Clause
Author Carlo Hamalainen
Category Development
Home page
Uploaded by CarloHamalainen at 2014-01-22T05:56:13Z
Distributions NixOS:
Executables ghc-imported-from
Downloads 11992 total (19 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Successful builds reported [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for ghc-imported-from-

[back to package description]


For a given Haskell source file, determine the path to the Haddock documentation for a symbol at a particular line/col location.

Example: on the file Muddle.hs,

../.cabal-sandbox/bin/ghc-imported-from Muddle.hs Muddle Maybe 11 11


SUCCESS: /home/carlo/opt/ghc-7.6.3_build/share/doc/ghc/html/libraries/base-

since the usage of Maybe at line 11, column 11, is from the Data.Maybe module.

Difficulties arise because some symbols are exported from a certain package but defined in another, for example String is defined in GHC.Base but is exported from the standard prelude, the module Prelude. There are other cases to deal with including qualified imports, selective imports, imports with hidden components, etc.

Preference is given to any locally available Haddock documentation, and then to the generic url at



Install into ~/.cabal:

git clone
cd ghc-imported-from
cabal install

Or, install into a sandbox:

git clone
cd ghc-imported-from

Either way, ensure that ghc-imported-from is in the current PATH.


Follow the instructions at to install the Vim plugin.


See the tests subdirectory for some examples. Or load your favourite Haskell project and hit F4.

Or watch the screencast (be sure to set 720p HD and then fullscreen):


If you use Cabal sandboxes, you'll have to hardcode the path to the package config file. This is a known issue:

Feedback and pull requests most welcome!