Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. Introducing the `stack hoogle` feature!
  2.  
  3. With the release of hoogle5, we can now hoogle all packages referenced
  4. by our packages in our `stack.yaml`. This feature is on the master
  5. branch of stack, but is not yet on a stack release. We'd like you to
  6. try it out before we do!
  7.  
  8. To upgrade to the latest stack from git, use:
  9.  
  10. $ stack upgrade --git
  11.  
  12. Now, in any stack project, run:
  13.  
  14. $ stack hoogle map
  15.  
  16. After a bunch of setup work (see below), you'll get something like
  17.  
  18. bash-3.2$ stack hoogle map
  19. map :: (a -> b) -> [a] -> [b]
  20. map :: (Word8 -> Word8) -> ByteString -> ByteString
  21. [..]
  22.  
  23. Pass `-i` to show documentation:
  24.  
  25. bash-3.2$ stack hoogle -- -i map
  26. map :: (a -> b) -> [a] -> [b]
  27. base Prelude
  28. map f xs is the list obtained by applying f
  29. to each element of xs, i.e.,
  30.  
  31.  
  32. map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
  33. map f [x1, x2, ...] == [f x1, f x2, ...]
  34.  
  35. Each project has its own installation of hoogle:
  36.  
  37. bash-3.2$ stack exec which hoogle
  38. /Users/chris/Work/hs-popen/.stack-work/install/x86_64-osx/lts-5.3/7.10.3/bin/hoogle
  39.  
  40. Unless you install it globally, in which case it'll use the one in
  41. your PATH if it's >=5.0. So if you get sick of it installing copies of
  42. hoogle, do `stack install hoogle-5.0`.
  43.  
  44. Please give it a try!
  45.  
  46. ---
  47.  
  48. Hoogle5 is probably not installed on your system, so you'll see this
  49. message:
  50.  
  51. > Hoogle isn't installed or is too old. Automatically installing (use --no-setup to disable) ...
  52. > Minimum version is hoogle-5.0. Found acceptable hoogle-5.0 in your index, installing it.
  53.  
  54. After installing Hoogle5 it'll say:
  55.  
  56. > No Hoogle database yet. Automatically building haddocks and hoogle
  57. > database (use --no-setup to disable) ...
  58.  
  59. Then it'll run `stack haddock` and then `stack hoogle -- generate
  60. --local`.
  61.  
  62. If you see a message like
  63.  
  64. > Packages not found: abstract-par aeson aeson-compat [..]
  65.  
  66. Don't worry about it; stack only generates haddocks for the things
  67. you're using in your project, whereas hoogle is looking at everything
  68. in the snapshot database.
  69.  
  70. Relatedly, if you add a dependency to your project, run `stack hoogle
  71. --rebuild`, and that'll generate the haddocks and the hoogle database
  72. again.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement