|Version 1 (modified by 5 years ago) (diff),|
Making GHC's source code searchable with Hoogle
Hoogle is a great way to find the function you want, and it's easy to make Hoogle search your own GHC source code base.
- Build GHC from source. IIRC you just need to get it to build with the HADDOCK options on.) When done, it produces the following file:
ghc.txtis the hoogle database.
- Hoist the file out somewhere:
cp ghc.txt ~/
- If you want the search results to link to the standard GHC docs rather than the files you built from, then change the line at the top of ghc.txt to something like
- Install hoogle
cabal install hoogleand populate its default database:
- Convert the hoogle database into .hoo
cd ~/ ./cabal/bin/hoogle convert ghc.txtThis should produce a file
- Copy the .hoo file into the hoogle directory:
cp ~/ghc.hoo ~/.cabal/share/hoogle-4.2.2/databases/default.hoo(The above is odd -- it "blows out" the default hoogleDB file and replaces it with the GHC database)
- Fire up a hoogle server:
sudo .cabal/bin/hoogle server --port=80
- Point your browser to
localhost:80and you're off!