Haddock interfaces produced from `.hi` files
= Summary This is a large architectural change to how Haddock interfaces are computed. This is a rebased variant of the second half of Simon Jakobi's (@sjakobi) Hi Haddock GSOC project. The idea is to work over top of the contents of `.hi` files instead of over the internal compiler representations of ASTs. This has a wide array of benefits, but two main ones are: * Haddock doesn't necessarily need to recompile modules to generate docs - if the right `.hi` files already exist, it'll automatically load them. Even better: this is nothing more that the existing recompilation avoidance logic in GHC. * Haddock no longer operates over concrete syntax - all declarations in the final docs are the result of reifying a `TyThing`. This means that the docs can be somewhat agnostic of users' particular choice to add certain kind annotations, use certain special syntax, etc. == Before Very roughly the previous way this worked was: 1. `depanal` is used to figure out the dependency order in which modules should be loaded 2. `parseModule` and `typecheckModule` are used to get a `TypecheckedModule` for every input module 3. The parsed and renamed sources in the typechecked module are traversed in various ways accumulating all the right info == After Now, the process 1. `GhcMake.load'` is used to load `.hi`-files into GHC 2. `loadSysInterface` is used to lookup the `ModIface` associated with each module
Showing
- .gitignore 4 additions, 0 deletions.gitignore
- doc/cheatsheet/haddocks.md 2 additions, 3 deletionsdoc/cheatsheet/haddocks.md
- doc/invoking.rst 0 additions, 19 deletionsdoc/invoking.rst
- doc/markup.rst 7 additions, 6 deletionsdoc/markup.rst
- haddock-api/src/Documentation/Haddock.hs 0 additions, 1 deletionhaddock-api/src/Documentation/Haddock.hs
- haddock-api/src/Haddock.hs 13 additions, 2 deletionshaddock-api/src/Haddock.hs
- haddock-api/src/Haddock/Backends/Hyperlinker.hs 2 additions, 3 deletionshaddock-api/src/Haddock/Backends/Hyperlinker.hs
- haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs 1 addition, 1 deletionhaddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
- haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs 2 additions, 2 deletionshaddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
- haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs 1 addition, 1 deletionhaddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs
- haddock-api/src/Haddock/Backends/LaTeX.hs 43 additions, 33 deletionshaddock-api/src/Haddock/Backends/LaTeX.hs
- haddock-api/src/Haddock/Backends/Xhtml.hs 4 additions, 7 deletionshaddock-api/src/Haddock/Backends/Xhtml.hs
- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs 71 additions, 28 deletionshaddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs 7 additions, 9 deletionshaddock-api/src/Haddock/Backends/Xhtml/Layout.hs
- haddock-api/src/Haddock/Backends/Xhtml/Names.hs 2 additions, 16 deletionshaddock-api/src/Haddock/Backends/Xhtml/Names.hs
- haddock-api/src/Haddock/Backends/Xhtml/Utils.hs 5 additions, 13 deletionshaddock-api/src/Haddock/Backends/Xhtml/Utils.hs
- haddock-api/src/Haddock/GhcUtils.hs 6 additions, 0 deletionshaddock-api/src/Haddock/GhcUtils.hs
- haddock-api/src/Haddock/Interface.hs 33 additions, 36 deletionshaddock-api/src/Haddock/Interface.hs
- haddock-api/src/Haddock/Interface/AttachInstances.hs 23 additions, 5 deletionshaddock-api/src/Haddock/Interface/AttachInstances.hs
- haddock-api/src/Haddock/Interface/Create.hs 316 additions, 789 deletionshaddock-api/src/Haddock/Interface/Create.hs
Loading