Miscellaneous improvements to `Convert` (#1020)
Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms
parent
a0973d09
No related branches found
No related tags found
Showing
- haddock-api/src/Haddock/Backends/Hoogle.hs 7 additions, 2 deletionshaddock-api/src/Haddock/Backends/Hoogle.hs
- haddock-api/src/Haddock/Backends/LaTeX.hs 5 additions, 5 deletionshaddock-api/src/Haddock/Backends/LaTeX.hs
- haddock-api/src/Haddock/Convert.hs 322 additions, 143 deletionshaddock-api/src/Haddock/Convert.hs
- haddock-api/src/Haddock/GhcUtils.hs 109 additions, 1 deletionhaddock-api/src/Haddock/GhcUtils.hs
- haddock-api/src/Haddock/Interface/Create.hs 1 addition, 1 deletionhaddock-api/src/Haddock/Interface/Create.hs
- hoogle-test/ref/Bug873/test.txt 1 addition, 1 deletionhoogle-test/ref/Bug873/test.txt
- html-test/ref/Bug548.html 6 additions, 2 deletionshtml-test/ref/Bug548.html
- html-test/ref/Instances.html 3 additions, 11 deletionshtml-test/ref/Instances.html
- html-test/ref/Operators.html 3 additions, 7 deletionshtml-test/ref/Operators.html
- html-test/ref/PatternSyns.html 11 additions, 31 deletionshtml-test/ref/PatternSyns.html
- html-test/ref/TypeFamilies.html 4 additions, 36 deletionshtml-test/ref/TypeFamilies.html
Loading
Please register or sign in to comment