aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/LaTeX.hs
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-mergeBen Gamari2021-02-061-0/+1
|\
| * type level characters support for haddock (required for #11342)Daniel Rogozin2021-02-051-0/+1
| |
| * Abstract Monad for interface creationAlex Biehl2021-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName.
* | Merge remote-tracking branch 'origin/ghc-9.0' into ghc-headBen Gamari2021-01-131-131/+153
|\ \ | |/ |/|
| * Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0Ben Gamari2021-01-051-134/+155
| |\
| | * Changes for GHC#17566Alex Biehl2020-12-081-1/+1
| | | | | | | | | | | | See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469
| | * Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL`Alec Theriault2020-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes #978
| | * Use TTG empty extensions to remove some `error`'sAlec Theriault2020-03-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`.
| | * Clean up warningsAlec Theriault2020-03-221-8/+1
| | | | | | | | | | | | | | | | | | * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal`
| | * Merge branch 'ghc-8.8' into ghc-8.10Alec Theriault2020-03-201-138/+168
| | |\
| | | * Matching changes in GHC for #16236Alan Zimmerman2019-03-291-3/+3
| | | | | | | | | | | | | | | | (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576)
| | | * Many LaTeX backend fixesAlec Theriault2019-03-091-98/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes #935, #929 (LaTeX docs for `text` build & compile) Fixes #727, #930 (I think both are really about type families...)
| | | * Avoid multi-line `emph` in LaTeX backendAlec Theriault2019-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes #936.
| | | * Better support for default methods in classesAlec Theriault2019-03-091-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types
| | | * Merge branch 'ghc-8.6' into ghc-8.8Alec Theriault2019-03-031-23/+30
| | | |\
| | | | * Keep forall on H98 existential data constructors (#1003)Alec Theriault2019-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes #1002.
| | | | * More uniform handling of `forall`'s in HTML/LaTeXAlec Theriault2018-11-261-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes #973
| | | * | Better identifier parsingAlec Theriault2019-02-251-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental).
* | | | | Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonymRyan Scott2020-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | Needed for !4417, the fix for GHC#15706 and GHC#18914.
* | | | | Display linear/multiplicity arrows correctly (#1238)Krzysztof Gogolewski2020-12-161-3/+11
| | | | | | | | | | | | | | | | | | | | Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b.
* | | | | Merge pull request #1257 from AndreasPK/wip/andreask/opt_dumpsBen Gamari2020-12-031-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Update for changes in GHC's Pretty
| * | | | | Update for changes in GHC's PrettyAndreas Klebinger2020-11-241-1/+1
| | | | | |
* | | | | | Add type arguments to PrefixConCale Gibbard2020-11-251-2/+2
|/ / / / /
* | | | | Adapt to HsOuterTyVarBndrsRyan Scott2020-10-301-21/+45
| | | | | | | | | | | | | | | | | | | | | | | | | These changes accompany ghc/ghc!4107, which aims to be a fix for #16762.
* | | | | Adapt to HsConDecl{H98,GADT}Details splitRyan Scott2020-10-301-14/+16
| | | | | | | | | | | | | | | | | | | | Needed for GHC#18844.
* | | | | Add whitespace in: map ($ v)Vladislav Zavialov2020-10-151-3/+3
| | | | |
* | | | | Fix after Outputable refactoringSylvain Henry2020-08-051-1/+1
| | | | |
* | | | | Update for modular ping pongZubin Duggal2020-07-231-1/+0
|/ / / /
* | | | Adapt Haddock to LinearTypesKrzysztof Gogolewski2020-06-171-8/+9
| | | | | | | | | | | | | | | | See ghc/ghc!852.
* | | | Use HsForAllTelescope (GHC#18235)Ryan Scott2020-06-131-12/+12
| | | |
* | | | Changes for GHC#18191Ryan Scott2020-06-051-1/+1
| | | | | | | | | | | | | | | | See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337.
* | | | Explicit Specificity Support for HaddockGert-Jan Bottu2020-05-201-6/+19
| | | |
* | | | Module structureSylvain Henry2020-04-241-4/+4
| | | |
* | | | Make NoExtCon fields strictRyan Scott2020-04-071-8/+0
| | | | | | | | | | | | | | | | | | | | These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992).
* | | | Modules: TypesSylvain Henry2020-03-201-4/+4
| | | |
* | | | Changes for GHC#17566Ryan Scott2020-01-251-1/+1
|/ / / | | | | | | | | | See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469
* | | Changes for #15247Ryan Scott2019-07-031-18/+18
| | |
* | | Visible dependent quantification (#16326) changesRyan Scott2019-02-271-4/+12
| | |
* | | Matching changes in GHC for #16236Alan Zimmerman2019-02-051-3/+3
|/ /
* | Miscellaneous improvements to `Convert` (#1020)Alec Theriault2019-02-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Visible kind application haddock updatemynguyen2018-12-301-4/+18
| |
* | Refactor names + unused functions (#982)Alec Theriault2018-12-171-9/+6
| | | | | | | | | | | | | | This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions
* | [TTG: Handling Source Locations] Foundation and PatShayan-Najd2018-11-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | Trac Issues #15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`)
* | Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag changeAlp Mestanogullari2018-11-151-2/+3
| | | | | | | | It got introduced in ghc/ghc@ae2c9b40f5b6bf272251d1f4107c60003f541b62.
* | Merge branch 'ghc-8.6' into ghc-headAlec Theriault2018-11-101-5/+5
|\|
| * Fix documentation in `haddock-api` (#957)Alec Theriault2018-10-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK
| * Latex type families (#734)Alec Theriault2018-10-161-24/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests
| * Update the ghc-8.6 branch (#889)Simon Jakobi2018-07-201-76/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes #879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes #873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes #877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see #191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071)
* | Support hyperlink labels with inline markupAlec Theriault2018-11-061-3/+3
| | | | | | | | The parser for pictures hasn't been properly adjusted yet.
* | Set UTF-8 encoding before writing files (#934)Alec Theriault2018-10-161-2/+2
| | | | | | | | | | This should fix #929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8).