Context: Before stack I stopped using hoogle locally because my index would somehow lose sync with installed packages. If I recall correctly, I had issues with different results in ghci, command line and cabal sandboxes.
Can I leverage stack environment manage my local hoogle databases?
For the Hoogle part I recommend using the latest git version, which will become version 5. To install that, do:
git clone https://github.com/ndmitchell/hoogle.git
cd hoogle
stack init
stack install
Then generate it and use it with:
# generate Haddock docs for all your packages
stack haddock
# generate the Hoogle index
stack exec -- hoogle generate --local --database=.stack-work/hoogle
# perform a search for map
stack exec -- hoogle map --database=.stack-work/hoogle
# start a server at http://127.0.0.1/ to browse docs
stack exec -- hoogle server --local --database=.stack-work/hoogle
To make this work with Cabal instead of Stack, do cabal install initially, set your haddock/hoogle preference in your Cabal config file to True, and remove the stack exec bits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With