Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,265
    • Issues 4,265
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 419
    • Merge Requests 419
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Wiki
    • Building
  • hoogle

Last edited by Simon Peyton Jones May 02, 2012
Page history New page

hoogle

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:

    $(TOP)/compiler/stage2/doc/html/ghc/ghc.txt

    The ghc.txt is 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

    @url http://www.haskell.org/ghc/docs/7.4.1/html/libraries/ghc-7.4.1/
  • Install hoogle

    cabal install hoogle 

    and populate its default database:

    ./cabal/bin/hoogle data
  • Convert the hoogle database into .hoo

    cd ~/
    ./cabal/bin/hoogle convert ghc.txt

    This should produce a file ghc.hoo

  • 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:80 and you're off!

Clone repository

GHC Home
GHC User's Guide

Joining In

Newcomers info
Mailing Lists & IRC
The GHC Team

Documentation

GHC Status Info
Working conventions
Building Guide
Debugging
Commentary

Wiki

Title Index
Recent Changes