diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2020-03-20 20:17:01 -0400 |
---|---|---|
committer | Alec Theriault <alec.theriault@gmail.com> | 2020-03-20 20:17:01 -0400 |
commit | 053c9add568dad4264f4629bff0de9b10d9316e1 (patch) | |
tree | 0e6f4de693a1748fb59df1ef32e5596e6008af0b | |
parent | 70f4b3a03a47b38ee301f0da9c72d5a7ff0ed9b0 (diff) | |
parent | dae8d9de6aaf3913a3776f1af235fb72404e9970 (diff) |
Merge branch 'ghc-8.8' into ghc-8.10
230 files changed, 8324 insertions, 1535 deletions
diff --git a/.arcconfig b/.arcconfig deleted file mode 100644 index 0693c58f..00000000 --- a/.arcconfig +++ /dev/null @@ -1,5 +0,0 @@ -{ - "project.name" : "haddock", - "repository.callsign" : "HADDOCK", - "phabricator.uri" : "https://phabricator.haskell.org" -} diff --git a/.arclint b/.arclint deleted file mode 100644 index 01f217d7..00000000 --- a/.arclint +++ /dev/null @@ -1,24 +0,0 @@ -{ - "linters": { - "filename": { - "type": "filename" - }, - "generated": { - "type": "generated" - }, - "merge-conflict": { - "type": "merge-conflict" - }, - "nolint": { - "type": "nolint" - }, - "haskell": { - "type": "text", - "include": ["(\\.(l?hs(-boot)?|x|y\\.pp)(\\.in)?$)"], - "severity": { - "5": "disabled", - "2": "warning" - } - } - } -} @@ -1 +0,0 @@ -:set --itest -idist/build -idist/build/autogen -packageghc -optP-include -optPdist/build/autogen/cabal_macros.h @@ -8,6 +8,12 @@ /latex-test/out/ /hoogle-test/out/ +*.o +*.hi +*.dyn_o +*.dyn_hi +*.hp + /doc/haddock /doc/haddock.ps /doc/haddock.pdf diff --git a/.travis.yml b/.travis.yml index a74a3728..88292b40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,29 @@ -# NOTE: manually changes were made to an otherwise autogenerated script. This is to -# query GHC CI artifacts instead of going via Herbert's PPA -# # This Travis job script has been generated by a script via # -# make_travis_yml_2.hs 'haddock.cabal' +# haskell-ci 'haddock.cabal' '--output' '.travis.yml' +# +# For more information, see https://github.com/haskell-CI/haskell-ci # -# For more information, see https://github.com/hvr/multi-ghc-travis +# version: 0.5.20190916 # language: c -sudo: false - +dist: xenial git: - submodules: false # whether to recursively clone submodules - + # whether to recursively clone submodules + submodules: false cache: directories: - $HOME/.cabal/packages - $HOME/.cabal/store - before_cache: - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log + - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log # remove files that are regenerated by 'cabal update' - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.* - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx - - - rm -rfv $HOME/.cabal/packages/head.hackage - + - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.* + - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json + - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache + - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar + - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx + - rm -rfv $CABALHOME/packages/head.hackage matrix: include: - os: linux @@ -37,68 +32,106 @@ matrix: - GHC_ZIP='https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/download?job=validate-x86_64-linux-deb9' before_install: - # Manually install GHC validate artifact - - travis_retry curl -L $GHC_ZIP --output artifact.zip - - unzip artifact.zip - - tar xpf ghc.tar.xz --strip-components 1 - - ./configure - - sudo make V=1 install - - # Set up some vars - - HC=ghc - - HCPKG=${HC/ghc/ghc-pkg} - - PATH=/usr/local/bin:/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH - - PKGNAME='haddock' - + - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//') + - WITHCOMPILER="-w $HC" + - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//') + - HCPKG="$HC-pkg" + - unset CC + - CABAL=/opt/ghc/bin/cabal + - CABALHOME=$HOME/.cabal + - export PATH="$CABALHOME/bin:$PATH" + - TOP=$(pwd) + - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')" + - echo $HCNUMVER + - CABAL="$CABAL -vnormal+nowrap+markoutput" + - set -o pipefail + - | + echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk + echo 'BEGIN { state = "output"; }' >> .colorful.awk + echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk + echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk + echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk + echo ' if (state == "cabal") {' >> .colorful.awk + echo ' print blue($0)' >> .colorful.awk + echo ' } else {' >> .colorful.awk + echo ' print $0' >> .colorful.awk + echo ' }' >> .colorful.awk + echo '}' >> .colorful.awk + - cat .colorful.awk + - | + color_cabal_output () { + awk -f $TOP/.colorful.awk + } + - echo text | color_cabal_output install: - - cabal --version - - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" - - BENCH=--enable-benchmarks - - TEST=--enable-tests - - travis_retry cabal update -v - - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config - - rm -fv cabal.project.local - - rm -f cabal.project.freeze - # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage - - | - sed -i 's/-- allow-newer: .*/allow-newer: *:base/' ${HOME}/.cabal/config - for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" ${HOME}/.cabal/config; done - - echo 'repository head.hackage' >> ${HOME}/.cabal/config - echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config - echo ' secure: True' >> ${HOME}/.cabal/config - echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config - echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config - echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config - echo ' key-threshold: 3' >> ${HOME}/.cabal.config - - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' - - cabal new-update head.hackage -v - - travis_retry cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 --allow-newer --constraint 'setup.Cabal installed' all - - travis_retry cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 --allow-newer --constraint 'setup.Cabal installed' all - -# Here starts the actual work to be performed for the package under test; -# any command which exits with a non-zero exit code causes the build to fail. + - ${CABAL} --version + - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" + - TEST=--enable-tests + - BENCH=--enable-benchmarks + - HEADHACKAGE=false + - rm -f $CABALHOME/config + - | + echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config + echo "remote-build-reporting: anonymous" >> $CABALHOME/config + echo "write-ghc-environment-files: always" >> $CABALHOME/config + echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config + echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config + echo "world-file: $CABALHOME/world" >> $CABALHOME/config + echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config + echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config + echo "installdir: $CABALHOME/bin" >> $CABALHOME/config + echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config + echo "store-dir: $CABALHOME/store" >> $CABALHOME/config + echo "install-dirs user" >> $CABALHOME/config + echo " prefix: $CABALHOME" >> $CABALHOME/config + echo "repository hackage.haskell.org" >> $CABALHOME/config + echo " url: http://hackage.haskell.org/" >> $CABALHOME/config + - | + echo "program-default-options" >> $CABALHOME/config + echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config + - cat $CABALHOME/config + - rm -fv cabal.project.local cabal.project.freeze + - travis_retry ${CABAL} v2-update -v + # Generate cabal.project + - rm -rf cabal.project.local cabal.project.freeze + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(haddock)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" + - cat cabal.project || true + - cat cabal.project.local || true + - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi + - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output + - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" + - rm cabal.project.freeze + - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all | color_cabal_output + - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all | color_cabal_output script: - - if [ -f configure.ac ]; then autoreconf -i; fi - - rm -rf dist/ - - cabal new-sdist # test that a source-distribution can be generated - - cd dist-newstyle/sdist/ - - SRCTAR=(${PKGNAME}-*.tar.gz) - - SRC_BASENAME="${SRCTAR/%.tar.gz}" - - tar -xvf "./$SRC_BASENAME.tar.gz" - - cd "$SRC_BASENAME/" -## from here on, CWD is inside the extracted source-tarball - - rm -fv cabal.project.local - # this builds all libraries and executables (without tests/benchmarks) - - rm -f cabal.project.freeze - - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --allow-newer --constraint 'setup.Cabal installed' all - # this builds all libraries and executables (including tests/benchmarks) - # - rm -rf ./dist-newstyle - - # build & run tests - - cabal new-build -w ${HC} ${TEST} ${BENCH} --allow-newer --constraint 'setup.Cabal installed' all - - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} --allow-newer --constraint 'setup.Cabal installed' all; fi + - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) + # Packaging... + - ${CABAL} v2-sdist all | color_cabal_output + # Unpacking... + - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/ + - cd ${DISTDIR} || false + - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \; + - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \; + # Generate cabal.project + - rm -rf cabal.project cabal.project.local cabal.project.freeze + - touch cabal.project + - | + echo "packages: ./haddock-*" >> cabal.project + - | + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(haddock)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" + - cat cabal.project || true + - cat cabal.project.local || true + # Building... + # this builds all libraries and executables (without tests/benchmarks) + - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output + # Building with tests and benchmarks... + # build & run tests, build benchmarks + - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output + # Testing... + - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output + # Building without installed constraints for packages in global-db... + - rm -f cabal.project.local + - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output +# REGENDATA ["haddock.cabal","--output",".travis.yml"] # EOF @@ -1,6 +1,6 @@ -## Changes in TBA +## Changes in 2.23.0 - * NewOcean is the new default theme (#721, #782, #949) + * "Linuwial" is the new default theme (#721, #782, #949) * Fix style switcher (enabled by `--built-in-themes`) (#949) @@ -12,6 +12,25 @@ * The hyperlinker backend lexer is now more incremental, faster, and more memory efficient (#977) + * Add an "Instances" menu item to the HTML backend for controlling + settings related to expanding/collapsing instances (#1007) + + * Improved identifier links including value/type namespaces, and + hyperlinking of parenthesized/backticked identifiers + + * Substantial bugfixes for converting `TyThing` back into source + declarations (#1003, #1005, #1022, #1020) + + * `--show-interface` now outputs to stdout (instead of stderr) + + * Render associated type defaults and also improve rendering of + default method signatures + + * Many fixes to the LaTeX backend, mostly focused on not crashing + as well as generating LaTeX source that compiles + + * More flexible parsing of the module header + ## Changes in version 2.22.0 * Make `--package-version` optional for `--hoogle` (#899) @@ -82,9 +82,9 @@ cabal test ```bash stack init -stack install +stack build # run the test suite -export HADDOCK_PATH="$HOME/.local/bin/haddock" +export HADDOCK_PATH="$(stack exec which haddock)" stack test ``` @@ -1,3 +0,0 @@ - -See http://github.com/waern/haskell-style-guide - diff --git a/doc/invoking.rst b/doc/invoking.rst index 9fd8f961..4e4b8764 100644 --- a/doc/invoking.rst +++ b/doc/invoking.rst @@ -330,7 +330,7 @@ The following options are available: reader can switch between themes with browsers that support alternate style sheets, or with the "Style" menu that gets added when the page is loaded. If no themes are specified, then just the - default built-in theme ("NewOcean") is used. + default built-in theme ("Linuwial") is used. The path parameter can be one of: @@ -342,11 +342,11 @@ The following options are available: - A *CSS file*: The base name of the file becomes the name of the theme. - - The *name* of a built-in theme ("NewOcean", "Ocean", or "Classic"). + - The *name* of a built-in theme ("Linuwial", "Ocean", or "Classic"). .. option:: --built-in-themes - Includes the built-in themes ("NewOcean", "Ocean", and "Classic"). Can be + Includes the built-in themes ("Linuwial", "Ocean", and "Classic"). Can be combined with :option:`--theme`. Note that order matters: The first specified theme will be the default. diff --git a/doc/markup.rst b/doc/markup.rst index 8f926961..08510804 100644 --- a/doc/markup.rst +++ b/doc/markup.rst @@ -913,6 +913,16 @@ If ``M.T`` is not otherwise in scope, then Haddock will simply emit a link pointing to the entity ``T`` exported from module ``M`` (without checking to see whether either ``M`` or ``M.T`` exist). +Since values and types live in different namespaces in Haskell, it is +possible for a reference such as ``'X'`` to be ambiguous. In such a case, +Haddock defaults to pointing to the type. The ambiguity can be overcome by explicitly specifying a namespace, by way of a ``v`` (for value) or ``t`` +(for type) immediately before the link: :: + + -- | An implicit reference to 'X', the type constructor + -- An explicit reference to v'X', the data constructor + -- An explicit reference to t'X', the type constructor + data X = X + To make life easier for documentation writers, a quoted identifier is only interpreted as such if the quotes surround a lexically valid Haskell identifier. This means, for example, that it normally isn't @@ -922,14 +932,9 @@ necessary to escape the single quote when used as an apostrophe: :: Nothing special is needed to hyperlink identifiers which contain apostrophes themselves: to hyperlink ``foo'`` one would simply type -``'foo''``. Hyperlinking operators works in exactly the same way. - -Note that it is not possible to directly hyperlink an identifier in infix -form or an operator in prefix form. The next best thing to do is to wrap -the whole identifier in monospaced text and put the parentheses/backticks -outside of the identifier, but inside the link: :: +``'foo''``. Hyperlinking operators works in exactly the same way. :: - -- | A prefix operator @('++')@ and an infix identifier @\``elem`\`@. + -- | A prefix operator @'(++)'@ and an infix identifier @'`elem`'@. Emphasis, Bold and Monospaced Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -45,8 +45,8 @@ utils/haddock_dist_DATA_FILES += html/Ocean.theme/minus.gif utils/haddock_dist_DATA_FILES += html/Ocean.theme/ocean.css utils/haddock_dist_DATA_FILES += html/Ocean.theme/plus.gif utils/haddock_dist_DATA_FILES += html/Ocean.theme/synopsis.png -utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/new-ocean.css -utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/synopsis.png +utils/haddock_dist_DATA_FILES += html/Linuwial.std-theme/linuwial.css +utils/haddock_dist_DATA_FILES += html/Linuwial.std-theme/synopsis.png utils/haddock_dist_DATA_FILES += html/solarized.css utils/haddock_dist_DATA_FILES += html/highlight.js utils/haddock_dist_DATA_FILES += latex/haddock.sty diff --git a/haddock-api/.ghci b/haddock-api/.ghci deleted file mode 100644 index 62e7c5d2..00000000 --- a/haddock-api/.ghci +++ /dev/null @@ -1 +0,0 @@ -:set -isrc -idist/build -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index aac3dfd8..8ad0ae64 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -1,6 +1,6 @@ cabal-version: 2.0 name: haddock-api -version: 2.22.0 +version: 2.23.0 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries @@ -34,16 +34,15 @@ data-files: html/Ocean.theme/ocean.css html/Ocean.theme/plus.gif html/Ocean.theme/synopsis.png - html/NewOcean.std-theme/new-ocean.css - html/NewOcean.std-theme/synopsis.png + html/Linuwial.std-theme/linuwial.css + html/Linuwial.std-theme/synopsis.png latex/haddock.sty library default-language: Haskell2010 -- this package typically supports only single major versions - build-depends: base ^>= 4.12.0 - , Cabal ^>= 2.4.0 + build-depends: base ^>= 4.14.0 , ghc ^>= 8.10 , ghc-paths ^>= 0.1.0.9 , haddock-library ^>= 1.8.0 @@ -66,7 +65,7 @@ library ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 ghc-options: -Wall if impl(ghc >= 8.0) - ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances + ghc-options: -Wcompat -Wnoncanonical-monad-instances exposed-modules: Documentation.Haddock @@ -166,13 +165,12 @@ test-suite spec Haddock.Backends.Hyperlinker.Parser Haddock.Backends.Hyperlinker.Types - build-depends: Cabal ^>= 2.4 - , ghc ^>= 8.9 - , ghc-paths ^>= 0.1.0.9 + build-depends: ghc ^>= 8.10 + , ghc-paths ^>= 0.1.0.12 , haddock-library ^>= 1.8.0 , xhtml ^>= 3000.2.2 - , hspec >= 2.4.4 && < 2.6 - , QuickCheck ^>= 2.11 + , hspec >= 2.4.4 && < 2.8 + , QuickCheck >= 2.11 && < 2.14 -- Versions for the dependencies below are transitively pinned by -- the non-reinstallable `ghc` package and hence need no version @@ -188,7 +186,7 @@ test-suite spec , transformers build-tool-depends: - hspec-discover:hspec-discover >= 2.4.4 && < 2.6 + hspec-discover:hspec-discover >= 2.4.4 && < 2.8 source-repository head type: git diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/Linuwial.std-theme/linuwial.css index 5450ae2e..cbb58a03 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css +++ b/haddock-api/resources/html/Linuwial.std-theme/linuwial.css @@ -11,7 +11,7 @@ html { body { background: #fefefe; - color: #333; + color: #111; text-align: left; min-height: 100vh; position: relative; @@ -234,7 +234,7 @@ Display the package name on top of the menu links and center both elements: */ body, button { - font: 400 15px/1.4 'PT Sans', + font: 400 14px/1.4 'PT Sans', /* Fallback Font Stack */ -apple-system, BlinkMacSystemFont, @@ -390,6 +390,8 @@ pre { margin: 1em 0 0 0; background-color: #f7f7f7; overflow: auto; + border: 1px solid #ddd; + border-radius: 0.3em; } pre + p { @@ -400,8 +402,15 @@ pre + pre { margin-top: 0.5em; } +blockquote { + border-left: 3px solid #c7a5d3; + background-color: #eee4f1; + margin: 0.5em; + padding: 0.0005em 0.3em 0.5em 0.5em; +} + .src { - background: #f4f4f4; + background: #f2f2f2; padding: 0.2em 0.5em; } @@ -461,42 +470,10 @@ table.info { text-align: right; } -div#style-menu-holder { - position: relative; - z-index: 2; - display: inline; -} - -#style-menu { - position: absolute; - z-index: 1; - overflow: visible; - background: #374c5e; - margin: 0; - text-align: center; - right: 0; - padding: 0; - top: 1.25em; -} - #style-menu li { - display: inline-block; + display: block; border-style: none; - margin: 0; - padding: 0; - color: #000; list-style-type: none; - border-top: 1px solid #919191 -} - -#style-menu li + li { - border-left: 1px solid #919191; -} - -#style-menu a { - width: 6em; - padding: 3px; - display: block; } #footer { @@ -526,7 +503,7 @@ div#style-menu-holder { } #contents-list { - background: #f7f7f7; + background: #f4f4f4; padding: 1em; margin: 0; } @@ -889,3 +866,12 @@ div#style-menu-holder { } /* @end */ + +/* @group Dropdown menus */ + +#preferences-menu, #style-menu { + width: 25em; + overflow-y: auto; +} + +/* @end */ diff --git a/haddock-api/resources/html/NewOcean.std-theme/synopsis.png b/haddock-api/resources/html/Linuwial.std-theme/synopsis.png Binary files differindex 85fb86ec..85fb86ec 100644 --- a/haddock-api/resources/html/NewOcean.std-theme/synopsis.png +++ b/haddock-api/resources/html/Linuwial.std-theme/synopsis.png diff --git a/haddock-api/resources/html/README.md b/haddock-api/resources/html/README.md index 0552f6fd..d555989d 100644 --- a/haddock-api/resources/html/README.md +++ b/haddock-api/resources/html/README.md @@ -13,4 +13,10 @@ After each change to the TypeScript sources, compile and copy the generated file ``` gulp && cp *.min.js path-to/generated-haddock-docs && cp *.js.map path-to/generated-haddock-docs -```
\ No newline at end of file +``` + +If you are editing the CSS, you'll also need to copy the edited CSS files. E.g. if you are editing the global/default quick-jump.css and the Linuwial theme's CSS, then + +``` +cp quick-jump.css Linuwial.std-theme/linuwial.css path-to/generated-haddock-docs +``` diff --git a/haddock-api/resources/html/haddock-bundle.min.js b/haddock-api/resources/html/haddock-bundle.min.js index 7881dc10..45adda98 100644 --- a/haddock-api/resources/html/haddock-bundle.min.js +++ b/haddock-api/resources/html/haddock-bundle.min.js @@ -1,2 +1,2 @@ -!function i(s,a,l){function c(t,e){if(!a[t]){if(!s[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=a[t]={exports:{}};s[t][0].call(r.exports,function(e){return c(s[t][1][e]||e)},r,r.exports,i,s,a,l)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)c(l[e]);return c}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.setCookie=function(e,t){document.cookie=e+"="+encodeURIComponent(t)+";path=/;"},n.clearCookie=function(e){document.cookie=e+"=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"},n.getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}return null}},{}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=e("./cookies"),s={},c={};function u(e){var t=s[e];if(null==t)throw new Error("could not find <details> element with id '"+e+"'");return t}function o(e){for(var t,n=e.target,o=n.id,r=u(o),i=r.element.open,s=0,a=r.toggles;s<a.length;s++){var l=a[s];l.classList.contains("details-toggle-control")&&(l.classList.add(i?"collapser":"expander"),l.classList.remove(i?"expander":"collapser"))}n.open==r.openByDefault?delete c[o]:c[o]=!0,t=Object.keys(c),document.cookie="toggled="+encodeURIComponent(t.join("+"))}function r(e){e.preventDefault();var t,n=e.currentTarget.getAttribute("data-details-id");if(!n)throw new Error("element with class 'details-toggle' has no 'data-details-id' attribute!");(t=u(n).element).open=!t.open}n.init=function(){!function(){for(var e=0,t=Array.prototype.slice.call(document.getElementsByTagName("details"));e<t.length;e++){var n=t[e];"string"==typeof n.id&&0<n.id.length&&(s[n.id]={element:n,openByDefault:!!n.open,toggles:[]},n.addEventListener("toggle",o))}}(),function(){var e=i.getCookie("toggled");if(e)for(var t=0,n=e.split("+");t<n.length;t++){var o=n[t],r=s[o];c[o]=!0,r&&(r.element.open=!r.element.open)}}(),Array.prototype.slice.call(document.getElementsByClassName("details-toggle")).forEach(function(e){var t=e.getAttribute("data-details-id");if(!t)throw new Error("element with class 'details-toggle' has no 'data-details-id' attribute!");var n=u(t);n.toggles.push(e),e.addEventListener("click",r),e.classList.contains("details-toggle-control")&&e.classList.add(n.element.open?"collapser":"expander")})}},{"./cookies":1}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,r=e("./style-menu"),i=e("./details-helper"),s=e("./quick-jump");o=function(){document.body.classList.add("js-enabled"),r.init(),i.init(),s.init()},"interactive"===document.readyState?o():document.addEventListener("readystatechange",function(){"interactive"===document.readyState&&o()})},{"./details-helper":2,"./quick-jump":4,"./style-menu":5}],4:[function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var i=e("fuse.js"),s=e("preact"),a=s.h,l=s.Component;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(t){return a("li",null,a("a",{href:"#",onClick:function(e){e.preventDefault(),t.onClick()}},t.title))},t}(l);function u(e){var t=document.querySelector("#page-menu"),n=document.createElement("li");t.insertBefore(n,t.firstChild),s.render(a(c,{onClick:e,title:"Quick Jump"}),t,n)}function h(e,t){return t.length<=e?t:t.slice(0,e)}var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.linkIndex=0,e.focusPlease=!1,e.navigatedByKeyboard=!1,e}return r(e,t),e.prototype.componentWillMount=function(){var e,t,n,o,r=this;this.setState({searchString:"",isVisible:!1,expanded:{},activeLinkIndex:-1,moduleResults:[]}),e=this.props.baseUrl+"/doc-index.json",t=function(e){r.setState({fuse:new i(e,{threshold:.25,caseSensitive:!0,includeScore:!0,tokenize:!0,keys:[{name:"name",weight:.7},{name:"module",weight:.3}]}),moduleResults:[]})},n=function(e){console&&console.error("could not load 'doc-index.json' for searching",e),r.setState({failedLoading:!0})},(o=new XMLHttpRequest).onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE)if(200===o.status){if(t)try{t(JSON.parse(o.responseText))}catch(e){n(o)}}else n&&n(o)},o.open("GET",e,!0),o.send(),document.addEventListener("mousedown",this.hide.bind(this)),document.addEventListener("keydown",function(e){r.state.isVisible&&("Escape"===e.key?r.hide():"ArrowUp"===e.key||"k"===e.key&&e.ctrlKey?(e.preventDefault(),r.navigateLinks(-1)):"ArrowDown"===e.key||"j"===e.key&&e.ctrlKey?(e.preventDefault(),r.navigateLinks(1)):"Enter"===e.key&&0<=r.state.activeLinkIndex&&r.followActiveLink()),"s"===e.key&&"input"!==e.target.tagName.toLowerCase()&&(e.preventDefault(),r.show())})},e.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},e.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},e.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},e.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},e.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},e.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t=this.state.fuse.search(e),o={};t.forEach(function(e){var t=e.item.module;(o[t]||(o[t]=[])).push(e)});var r=[],n=function(e){var t=o[e],n=0;t.forEach(function(e){n+=1/e.score}),r.push({module:e,totalScore:1/n,items:t})};for(var i in o)n(i);r.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:r})},e.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.top<t&&(this.searchResults.scrollTop-=t-e.top+80)}this.focusPlease&&this.input&&this.input.focus(),this.navigatedByKeyboard=!1,this.focusPlease=!1},e.prototype.componentDidMount=function(){this.props.showHideTrigger(this.toggleVisibility.bind(this))},e.prototype.render=function(e,t){var r=this;if(t.failedLoading){var n="file:"==window.location.protocol;return a("div",{id:"search",class:t.isVisible?"":"hidden"},a("div",{id:"search-results"},a("p",{class:"error"},"Failed to load file 'doc-index.json' containing definitions in this package."),n?a("p",{class:"error"},"To use quick jump, load this page with HTTP (from a local static file web server) instead of using the ",a("code",null,"file://")," protocol. (For security reasons, it is not possible to fetch auxiliary files using JS in a HTML page opened with ",a("code",null,"file://"),".)"):[]))}this.linkIndex=0;var o=function(e){e.stopPropagation()},i=h(10,t.moduleResults).map(function(e){return r.renderResultsInModule(e)});return a("div",{id:"search",class:t.isVisible?"":"hidden"},a("div",{id:"search-form",onMouseDown:o},a("input",{placeholder:"Search in package by name",ref:function(e){r.input=e},onFocus:this.show.bind(this),onClick:this.show.bind(this),onInput:this.updateResults.bind(this)})),a("div",{id:"search-results",ref:function(e){r.searchResults=e},onMouseDown:o,onMouseOver:function(e){for(var t=e.target;t&&"function"==typeof t.getAttribute;){var n=t.getAttribute("data-link-index");if("string"==typeof n){var o=parseInt(n,10);r.setState({activeLinkIndex:o});break}t=t.parentNode}}},""===t.searchString?[a(v,null),a(f,null)]:0==i.length?a(g,{searchString:t.searchString}):a("ul",null,i)))},e.prototype.renderResultsInModule=function(e){var n=this,t=e.items,o=e.module,r=this.state.expanded[o]||t.length<=10,i=r?t:h(8,t);return a("li",{class:"search-module"},a("h4",null,o),a("ul",null,i.map(function(e){return t=e.item,a("li",{class:"search-result"},n.navigationLink(n.props.baseUrl+"/"+t.link,{},a(p,{html:t.display_html})));var t}),r?[]:a("li",{class:"more-results"},this.actionLink(function(){var e=Object.assign({},n.state.expanded);e[o]=!0,n.setState({expanded:e})},{},"show "+(t.length-i.length)+" more results from this module"))))},e.prototype.navigationLink=function(e,t){for(var n=this,o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var i=Object.assign({href:e,onClick:this.hide.bind(this)},t);return this.menuLink.apply(this,[i,function(){window.location.href=e,n.hide()}].concat(o))},e.prototype.actionLink=function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=Object.assign({href:"#",onClick:function(e){e.preventDefault(),t()}},e);return this.menuLink.apply(this,[r,t].concat(n))},e.prototype.menuLink=function(e,t){for(var n=this,o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var i=this.linkIndex;i===this.state.activeLinkIndex&&(e.class=(e.class?e.class+" ":"")+"active-link",e.ref=function(e){e&&(n.activeLink=e)},this.activeLinkAction=t);var s=Object.assign({"data-link-index":i},e);return this.linkIndex+=1,a.apply(void 0,["a",s].concat(o))},e}(l),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.html!==e.html},t.prototype.render=function(e){return a("div",{dangerouslySetInnerHTML:{__html:e.html}})},t}(l);function f(){return a("table",{class:"keyboard-shortcuts"},a("tr",null,a("th",null,"Key"),a("th",null,"Shortcut")),a("tr",null,a("td",null,a("span",{class:"key"},"s")),a("td",null,"Open this search box")),a("tr",null,a("td",null,a("span",{class:"key"},"esc")),a("td",null,"Close this search box")),a("tr",null,a("td",null,a("span",{class:"key"},"↓"),",",a("span",{class:"key"},"ctrl")," + ",a("span",{class:"key"},"j")),a("td",null,"Move down in search results")),a("tr",null,a("td",null,a("span",{class:"key"},"↑"),",",a("span",{class:"key"},"ctrl")," + ",a("span",{class:"key"},"k")),a("td",null,"Move up in search results")),a("tr",null,a("td",null,a("span",{class:"key"},"↵")),a("td",null,"Go to active search result")))}function v(){return a("p",null,"You can find any exported type, constructor, class, function or pattern defined in this package by (approximate) name.")}function g(e){var t=[a("p",null,"Your search for '",e.searchString,"' produced the following list of results: ",a("code",null,"[]"),"."),a("p",null,a("code",null,"Nothing")," matches your query for '",e.searchString,"'."),a("p",null,a("code",null,"Left \"no matches for '",e.searchString,"'\" :: Either String (NonEmpty SearchResult)"))];return t[(e.searchString||"a").charCodeAt(0)%t.length]}function m(e,t){s.render(a(d,{baseUrl:e||".",showHideTrigger:t||u}),document.body)}n.init=m,window.quickNav={init:m}},{"fuse.js":6,preact:7}],5:[function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var i=e("./cookies"),s=e("preact"),a=s.h,l=s.Component,c=/\s\s+/g,u=/^\s+|\s+$/g;function h(e){return(" "+e+" ").replace(c," ")}function d(e){return e.replace(u,"")}function p(e,t){var n=h(e.className||"");n.indexOf(" "+t+" ")<0&&(e.className=d(n+" "+t))}function f(e,t){var n=h(e.className||"");n=n.replace(" "+t+" "," "),e.className=d(n)}function v(e,t,n,o){var r;return null==o&&(r=t,o=!(0<=h(e.className||"").indexOf(" "+r+" "))),o?(f(e,n),p(e,t)):(f(e,t),p(e,n)),o}var g,m,y=(g="show",m="hide",function(e,t){return v(e,g,m,t)});function _(){return Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(e){return-1!=e.rel.indexOf("style")&&e.title})}var k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(e){return a("li",null,a("div",{id:"style-menu-holder",onClick:function(){var e,t;return(t=document.getElementById("style-menu"))&&y(t,e),!1}},a("a",{href:"#"},"Style ▾"),a("ul",{id:"style-menu",class:"hide"},e.stys.map(function(e){return a("li",null,a("a",{href:"#",onClick:function(){return b(e),!1}},e))}))))},t}(l);function b(e){for(var t=_(),n=null,o=0;o<t.length;o++){var r=t[o];r.disabled=!0,r.title==e&&(n=r)}n?(n.disabled=!1,i.setCookie("haddock-style",e)):(t[0].disabled=!1,i.clearCookie("haddock-style"))}n.init=function(){var e;!function(){var e=_().map(function(e){return e.title});if(1<e.length){var t=document.querySelector("#page-menu"),n=document.createElement("li");t.appendChild(n),s.render(a(k,{stys:e,title:"Style"}),t,n)}}(),(e=i.getCookie("haddock-style"))&&b(e)}},{"./cookies":1,preact:7}],6:[function(e,t,n){var o,r;o=this,r=function(){return function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=n,r.c=o,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,n){"use strict";e.exports=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var o=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var u=n(5),h=n(7),_=n(4),r=function(){function y(e,t){var n=t.location,o=void 0===n?0:n,r=t.distance,i=void 0===r?100:r,s=t.threshold,a=void 0===s?.6:s,l=t.maxPatternLength,c=void 0===l?32:l,u=t.isCaseSensitive,h=void 0!==u&&u,d=t.tokenSeparator,p=void 0===d?/ +/g:d,f=t.findAllMatches,v=void 0!==f&&f,g=t.minMatchCharLength,m=void 0===g?1:g;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),this.options={location:o,distance:i,threshold:a,maxPatternLength:c,isCaseSensitive:h,tokenSeparator:p,findAllMatches:v,minMatchCharLength:m},this.pattern=this.options.isCaseSensitive?e:e.toLowerCase(),this.pattern.length<=c&&(this.patternAlphabet=_(this.pattern))}return o(y,[{key:"search",value:function(e){if(this.options.isCaseSensitive||(e=e.toLowerCase()),this.pattern===e)return{isMatch:!0,score:0,matchedIndices:[[0,e.length-1]]};var t=this.options,n=t.maxPatternLength,o=t.tokenSeparator;if(this.pattern.length>n)return u(e,this.pattern,o);var r=this.options,i=r.location,s=r.distance,a=r.threshold,l=r.findAllMatches,c=r.minMatchCharLength;return h(e,this.pattern,this.patternAlphabet,{location:i,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c})}}]),y}();e.exports=r},function(e,t,n){"use strict";var u=n(0);e.exports=function(e,t){return function e(t,n,o){if(n){var r=n.indexOf("."),i=n,s=null;-1!==r&&(i=n.slice(0,r),s=n.slice(r+1));var a=t[i];if(null!=a)if(s||"string"!=typeof a&&"number"!=typeof a)if(u(a))for(var l=0,c=a.length;l<c;l+=1)e(a[l],s,o);else s&&e(a,s,o);else o.push(a.toString())}else o.push(t);return o}(e,t,[])}},function(e,t,n){"use strict";e.exports=function(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i<s;i+=1){var a=e[i];a&&-1===o?o=i:a||-1===o||(t<=(r=i-1)-o+1&&n.push([o,r]),o=-1)}return e[i-1]&&t<=i-o&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o<n;o+=1)t[e.charAt(o)]=0;for(var r=0;r<n;r+=1)t[e.charAt(r)]|=1<<n-r-1;return t}},function(e,t,n){"use strict";var u=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(u,"\\$&").replace(n,"|")),r=e.match(o),i=!!r,s=[];if(i)for(var a=0,l=r.length;a<l;a+=1){var c=r[a];s.push([e.indexOf(c),c.length-1])}return{score:i?.5:1,isMatch:i,matchedIndices:s}}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.errors,o=void 0===n?0:n,r=t.currentLocation,i=void 0===r?0:r,s=t.expectedLocation,a=void 0===s?0:s,l=t.distance,c=void 0===l?100:l,u=o/e.length,h=Math.abs(a-i);return c?u+h/c:h?1:u}},function(e,t,n){"use strict";var U=n(6),R=n(3);e.exports=function(e,t,n,o){for(var r=o.location,i=void 0===r?0:r,s=o.distance,a=void 0===s?100:s,l=o.threshold,c=void 0===l?.6:l,u=o.findAllMatches,h=void 0!==u&&u,d=o.minMatchCharLength,p=void 0===d?1:d,f=i,v=e.length,g=c,m=e.indexOf(t,f),y=t.length,_=[],k=0;k<v;k+=1)_[k]=0;if(-1!==m){var b=U(t,{errors:0,currentLocation:m,expectedLocation:f,distance:a});if(g=Math.min(b,g),-1!==(m=e.lastIndexOf(t,f+y))){var x=U(t,{errors:0,currentLocation:m,expectedLocation:f,distance:a});g=Math.min(x,g)}}m=-1;for(var w=[],S=1,L=y+v,C=1<<y-1,M=0;M<y;M+=1){for(var N=0,A=L;N<A;){U(t,{errors:M,currentLocation:f+A,expectedLocation:f,distance:a})<=g?N=A:L=A,A=Math.floor((L-N)/2+N)}L=A;var O=Math.max(1,f-A+1),I=h?v:Math.min(f+A,v)+y,j=Array(I+2);j[I+1]=(1<<M)-1;for(var E=I;O<=E;E-=1){var T=E-1,P=n[e.charAt(T)];if(P&&(_[T]=1),j[E]=(j[E+1]<<1|1)&P,0!==M&&(j[E]|=(w[E+1]|w[E])<<1|1|w[E+1]),j[E]&C&&(S=U(t,{errors:M,currentLocation:T,expectedLocation:f,distance:a}))<=g){if(g=S,(m=T)<=f)break;O=Math.max(1,2*f-m)}}if(g<U(t,{errors:M+1,currentLocation:f,expectedLocation:f,distance:a}))break;w=j}return{isMatch:0<=m,score:0===S?.001:S,matchedIndices:R(_,p)}}},function(e,t,n){"use strict";var o=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var i=n(1),F=n(2),U=n(0),r=function(){function D(e,t){var n=t.location,o=void 0===n?0:n,r=t.distance,i=void 0===r?100:r,s=t.threshold,a=void 0===s?.6:s,l=t.maxPatternLength,c=void 0===l?32:l,u=t.caseSensitive,h=void 0!==u&&u,d=t.tokenSeparator,p=void 0===d?/ +/g:d,f=t.findAllMatches,v=void 0!==f&&f,g=t.minMatchCharLength,m=void 0===g?1:g,y=t.id,_=void 0===y?null:y,k=t.keys,b=void 0===k?[]:k,x=t.shouldSort,w=void 0===x||x,S=t.getFn,L=void 0===S?F:S,C=t.sortFn,M=void 0===C?function(e,t){return e.score-t.score}:C,N=t.tokenize,A=void 0!==N&&N,O=t.matchAllTokens,I=void 0!==O&&O,j=t.includeMatches,E=void 0!==j&&j,T=t.includeScore,P=void 0!==T&&T,U=t.verbose,R=void 0!==U&&U;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,D),this.options={location:o,distance:i,threshold:a,maxPatternLength:c,isCaseSensitive:h,tokenSeparator:p,findAllMatches:v,minMatchCharLength:m,id:_,keys:b,includeMatches:E,includeScore:P,shouldSort:w,getFn:L,sortFn:M,verbose:R,tokenize:A,matchAllTokens:I},this.setCollection(e)}return o(D,[{key:"setCollection",value:function(e){return this.list=e}},{key:"search",value:function(e){this._log('---------\nSearch pattern: "'+e+'"');var t=this._prepareSearchers(e),n=t.tokenSearchers,o=t.fullSearcher,r=this._search(n,o),i=r.weights,s=r.results;return this._computeScore(i,s),this.options.shouldSort&&this._sort(s),this._format(s)}},{key:"_prepareSearchers",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o<r;o+=1)t.push(new i(n[o],this.options));return{tokenSearchers:t,fullSearcher:new i(e,this.options)}}},{key:"_search",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i<s;i+=1)this._analyze({key:"",value:n[i],record:i,index:i},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t});return{weights:null,results:r}}for(var a={},l=0,c=n.length;l<c;l+=1)for(var u=n[l],h=0,d=this.options.keys.length;h<d;h+=1){var p=this.options.keys[h];if("string"!=typeof p){if(a[p.name]={weight:1-p.weight||1},p.weight<=0||1<p.weight)throw new Error("Key weight has to be > 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(u,p),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,a=e.index,l=t.tokenSearchers,c=void 0===l?[]:l,u=t.fullSearcher,h=void 0===u?[]:u,d=t.resultMap,p=void 0===d?{}:d,f=t.results,v=void 0===f?[]:f;if(null!=i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var _=h.search(i);if(this._log('Full text: "'+i+'", score: '+_.score),this.options.tokenize){for(var k=i.split(this.options.tokenSeparator),b=[],x=0;x<c.length;x+=1){var w=c[x];this._log('\nPattern: "'+w.pattern+'"');for(var S=!1,L=0;L<k.length;L+=1){var C=k[L],M=w.search(C),N={};M.isMatch?(N[C]=M.score,S=g=!0,b.push(M.score)):(N[C]=1,this.options.matchAllTokens||b.push(1)),this._log('Token: "'+C+'", score: '+N[C])}S&&(y+=1)}m=b[0];for(var A=b.length,O=1;O<A;O+=1)m+=b[O];m/=A,this._log("Token score average:",m)}var I=_.score;-1<m&&(I=(I+m)/2),this._log("Score average:",I);var j=!this.options.tokenize||!this.options.matchAllTokens||y>=c.length;if(this._log("\nCheck Matches: "+j),(g||_.isMatch)&&j){var E=p[a];E?E.output.push({key:n,arrayIndex:r,value:i,score:I,matchedIndices:_.matchedIndices}):(p[a]={item:s,output:[{key:n,arrayIndex:r,value:i,score:I,matchedIndices:_.matchedIndices}]},v.push(p[a]))}}else if(U(i))for(var T=0,P=i.length;T<P;T+=1)this._analyze({key:n,arrayIndex:T,value:i[T],record:s,index:a},{resultMap:p,results:v,tokenSearchers:c,fullSearcher:h})}}},{key:"_computeScore",value:function(e,t){this._log("\n\nComputing score:\n");for(var n=0,o=t.length;n<o;n+=1){for(var r=t[n].output,i=r.length,s=1,a=1,l=0;l<i;l+=1){var c=e?e[r[l].key].weight:1,u=(1===c?r[l].score:r[l].score||.001)*c;1!==c?a=Math.min(a,u):s*=r[l].nScore=u}t[n].score=1===a?s:a,this._log(t[n])}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];this.options.verbose&&this._log("\n\nOutput:\n\n",JSON.stringify(e));var n=[];this.options.includeMatches&&n.push(function(e,t){var n=e.output;t.matches=[];for(var o=0,r=n.length;o<r;o+=1){var i=n[o];if(0!==i.matchedIndices.length){var s={indices:i.matchedIndices,value:i.value};i.key&&(s.key=i.key),i.hasOwnProperty("arrayIndex")&&-1<i.arrayIndex&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o<r;o+=1){var i=e[o];if(this.options.id&&(i.item=this.options.getFn(i.item,this.options.id)[0]),n.length){for(var s={item:i.item},a=0,l=n.length;a<l;a+=1)n[a](i,s);t.push(s)}else t.push(i.item)}return t}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments)}}]),D}();e.exports=r}])},"object"==typeof n&&"object"==typeof t?t.exports=r():"function"==typeof define&&define.amd?define("Fuse",[],r):"object"==typeof n?n.Fuse=r():o.Fuse=r()},{}],7:[function(e,y,t){!function(){"use strict";function n(e,t){var n,o,r,i,s=h;for(i=arguments.length;2<i--;)u.push(arguments[i]);for(t&&null!=t.children&&(u.length||u.push(t.children),delete t.children);u.length;)if((o=u.pop())&&void 0!==o.pop)for(i=o.length;i--;)u.push(o[i]);else"boolean"==typeof o&&(o=null),(r="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(r=!1)),r&&n?s[s.length-1]+=o:s===h?s=[o]:s.push(o),n=r;var a=new c;return a.nodeName=e,a.children=s,a.attributes=null==t?void 0:t,a.key=null==t?void 0:t.key,void 0!==R.vnode&&R.vnode(a),a}function C(e,t){for(var n in t)e[n]=t[n];return e}function i(e){!e.__d&&(e.__d=!0)&&1==p.push(e)&&(R.debounceRendering||r)(t)}function t(){var e,t=p;for(p=[];e=t.pop();)e.__d&&P(e)}function L(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function M(e){var t=C({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function N(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===d.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,l,s):e.removeEventListener(t,l,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e){try{e[t]=null==o?"":o}catch(e){}null!=o&&!1!==o||"spellcheck"==t||e.removeAttribute(t)}else{var a=r&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function l(e){return this.__l[e.type](R.event&&R.event(e)||e)}function A(){for(var e;e=D.pop();)R.afterMount&&R.afterMount(e),e.componentDidMount&&e.componentDidMount()}function O(e,t,n,o,r,i){F++||(g=null!=r&&void 0!==r.ownerSVGElement,m=null!=e&&!("__preactattr_"in e));var s=I(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--F||(m=!1,i||A()),s}function I(e,t,n,o,r){var i=e,s=g;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),j(e,!0))),i.__preactattr_=!0,i;var a,l,c=t.nodeName;if("function"==typeof c)return function(e,t,n,o){var r=e&&e._component,i=r,s=e,a=r&&e._componentConstructor===t.nodeName,l=a,c=M(t);for(;r&&!l&&(r=r.__u);)l=r.constructor===t.nodeName;r&&l&&(!o||r._component)?(T(r,c,3,n,o),e=r.base):(i&&!a&&(U(i),e=s=null),r=E(t.nodeName,c,n),e&&!r.__b&&(r.__b=e,s=null),T(r,c,1,n,o),e=r.base,s&&e!==s&&(s._component=null,j(s,!1)));return e}(e,t,n,o);if(g="svg"===c||"foreignObject"!==c&&g,c=String(c),(!e||!L(e,c))&&(a=c,(l=g?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).__n=a,i=l,e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),j(e,!0)}var u=i.firstChild,h=i.__preactattr_,d=t.children;if(null==h){h=i.__preactattr_={};for(var p=i.attributes,f=p.length;f--;)h[p[f].name]=p[f].value}return!m&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&function(e,t,n,o,r){var i,s,a,l,c,u=e.childNodes,h=[],d={},p=0,f=0,v=u.length,g=0,m=t?t.length:0;if(0!==v)for(var y=0;y<v;y++){var _=u[y],k=_.__preactattr_,b=m&&k?_._component?_._component.__k:k.key:null;null!=b?(p++,d[b]=_):(k||(void 0!==_.splitText?!r||_.nodeValue.trim():r))&&(h[g++]=_)}if(0!==m)for(var y=0;y<m;y++){l=t[y],c=null;var b=l.key;if(null!=b)p&&void 0!==d[b]&&(c=d[b],d[b]=void 0,p--);else if(f<g)for(i=f;i<g;i++)if(void 0!==h[i]&&(x=s=h[i],S=r,"string"==typeof(w=l)||"number"==typeof w?void 0!==x.splitText:"string"==typeof w.nodeName?!x._componentConstructor&&L(x,w.nodeName):S||x._componentConstructor===w.nodeName)){c=s,h[i]=void 0,i===g-1&&g--,i===f&&f++;break}c=I(c,l,n,o),a=u[y],c&&c!==e&&c!==a&&(null==a?e.appendChild(c):c===a.nextSibling?N(a):e.insertBefore(c,a))}var x,w,S;if(p)for(var y in d)void 0!==d[y]&&j(d[y],!1);for(;f<=g;)void 0!==(c=h[g--])&&j(c,!1)}(i,d,n,o,m||null!=h.dangerouslySetInnerHTML),function(e,t,n){var o;for(o in n)t&&null!=t[o]||null==n[o]||v(e,o,n[o],n[o]=void 0,g);for(o in t)"children"===o||"innerHTML"===o||o in n&&t[o]===("value"===o||"checked"===o?e[o]:n[o])||v(e,o,n[o],n[o]=t[o],g)}(i,t.attributes,h),g=s,i}function j(e,t){var n=e._component;n?U(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||N(e),o(e))}function o(e){for(e=e.lastChild;e;){var t=e.previousSibling;j(e,!0),e=t}}function E(e,t,n){var o,r=f.length;for(e.prototype&&e.prototype.render?(o=new e(t,n),a.call(o,t,n)):((o=new a(t,n)).constructor=e,o.render=s);r--;)if(f[r].constructor===e)return o.__b=f[r].__b,f.splice(r,1),o;return o}function s(e,t,n){return this.constructor(e,n)}function T(e,t,n,o,r){e.__x||(e.__x=!0,e.__r=t.ref,e.__k=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||r?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o)),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===R.syncComponentUpdates&&e.base?i(e):P(e,1,r)),e.__r&&e.__r(e))}function P(e,t,n,o){if(!e.__x){var r,i,s,a=e.props,l=e.state,c=e.context,u=e.__p||a,h=e.__s||l,d=e.__c||c,p=e.base,f=e.__b,v=p||f,g=e._component,m=!1,y=d;if(e.constructor.getDerivedStateFromProps&&(l=C(C({},l),e.constructor.getDerivedStateFromProps(a,l)),e.state=l),p&&(e.props=u,e.state=h,e.context=d,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(a,l,c)?m=!0:e.componentWillUpdate&&e.componentWillUpdate(a,l,c),e.props=a,e.state=l,e.context=c),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!m){r=e.render(a,l,c),e.getChildContext&&(c=C(C({},c),e.getChildContext())),p&&e.getSnapshotBeforeUpdate&&(y=e.getSnapshotBeforeUpdate(u,h));var _,k,b=r&&r.nodeName;if("function"==typeof b){var x=M(r);(i=g)&&i.constructor===b&&x.key==i.__k?T(i,x,1,c,!1):(_=i,e._component=i=E(b,x,c),i.__b=i.__b||f,i.__u=e,T(i,x,0,c,!1),P(i,1,n,!0)),k=i.base}else s=v,(_=g)&&(s=e._component=null),(v||1===t)&&(s&&(s._component=null),k=O(s,r,c,n||!p,v&&v.parentNode,!0));if(v&&k!==v&&i!==g){var w=v.parentNode;w&&k!==w&&(w.replaceChild(k,v),_||(v._component=null,j(v,!1)))}if(_&&U(_),(e.base=k)&&!o){for(var S=e,L=e;L=L.__u;)(S=L).base=k;k._component=S,k._componentConstructor=S.constructor}}for(!p||n?D.unshift(e):m||(e.componentDidUpdate&&e.componentDidUpdate(u,h,y),R.afterUpdate&&R.afterUpdate(e));e.__h.length;)e.__h.pop().call(e);F||o||A()}}function U(e){R.beforeUnmount&&R.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?U(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),N(e.__b=t),f.push(e),o(t)),e.__r&&e.__r(null)}function a(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{},this.__h=[]}var c=function(){},R={},u=[],h=[],r="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,p=[],D=[],F=0,g=!1,m=!1,f=[];C(a.prototype,{setState:function(e,t){this.__s||(this.__s=this.state),this.state=C(C({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this.__h.push(t),i(this)},forceUpdate:function(e){e&&this.__h.push(e),P(this,2)},render:function(){}});var e={h:n,createElement:n,cloneElement:function(e,t){return n(e.nodeName,C(C({},e.attributes),t),2<arguments.length?[].slice.call(arguments,2):e.children)},Component:a,render:function(e,t,n){return O(n,e,{},!1,t,!1)},rerender:t,options:R};void 0!==y?y.exports=e:self.preact=e}()},{}]},{},[3]); +!function i(s,a,l){function c(t,e){if(!a[t]){if(!s[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=a[t]={exports:{}};s[t][0].call(r.exports,function(e){return c(s[t][1][e]||e)},r,r.exports,i,s,a,l)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)c(l[e]);return c}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.setCookie=function(e,t){document.cookie=e+"="+encodeURIComponent(t)+";path=/;"},n.clearCookie=function(e){document.cookie=e+"=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT;"},n.getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}return null}},{}],2:[function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var i,s,a=e("preact"),l=a.h,c=a.Component;(s=i||(i={}))[s.Closed=0]="Closed",s[s.Open=1]="Open";var u={defaultInstanceState:i.Open,rememberToggles:!0},d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(t){return l("li",null,l("a",{href:"#",onClick:function(e){e.preventDefault(),t.onClick()}},t.title))},t}(c);function h(e){var t=document.querySelector("#page-menu"),n=document.createElement("li");t.insertBefore(n,t.firstChild),a.render(l(d,{onClick:e,title:"Instances"}),t,n)}var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.componentWillMount=function(){var t=this;document.addEventListener("mousedown",this.hide.bind(this)),document.addEventListener("keydown",function(e){t.state.isVisible&&"Escape"===e.key&&t.hide()})},t.prototype.hide=function(){this.setState({isVisible:!1})},t.prototype.show=function(){this.state.isVisible||this.setState({isVisible:!0})},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.componentDidMount=function(){this.props.showHideTrigger(this.toggleVisibility.bind(this))},t.prototype.render=function(e,t){return l("div",{id:"preferences",class:t.isVisible?"":"hidden"},l("div",{id:"preferences-menu",class:"dropdown-menu",onMouseDown:function(e){e.stopPropagation()}},l(b,null)))},t}(c);function f(){var e=JSON.stringify(u);try{localStorage.setItem("global",e)}catch(e){}}var v=!1;function g(){if(!v){v=!0;var e=localStorage.getItem("global");if(e)try{var t=JSON.parse(e);u.defaultInstanceState=t.defaultInstanceState,u.rememberToggles=t.rememberToggles}catch(e){if(!(e instanceof SyntaxError||e instanceof TypeError))throw e;localStorage.removeItem("global")}}}function m(t){return function(e){u.defaultInstanceState=t,A(),f(),E(),O()}}function y(e){var t=e.target.checked;u.rememberToggles=t,f(),E(),O()}function _(e){var t=document.getElementById("default-collapse-instances");null!==t&&(t.checked?m(i.Closed)(e):m(i.Open)(e))}function b(){return g(),l("div",null,l("div",null,l("button",{type:"button",onClick:j},"Expand All Instances"),l("button",{type:"button",onClick:P},"Collapse All Instances")),l("div",null,l("input",{type:"checkbox",id:"default-collapse-instances",name:"default-instance-state",checked:u.defaultInstanceState===i.Closed,onClick:_}),l("span",null,"Collapse All Instances By Default")),l("div",null,l("input",{type:"checkbox",id:"remember-toggles",name:"remember-toggles",checked:u.rememberToggles,onClick:y}),l("label",{for:"remember-toggles"},"Remember Manually Collapsed/Expanded Instances")))}var k={};function S(e){var t=k[e];if(null==t)throw new Error("could not find <details> element with id '"+e+"'");return t}function x(){return u.defaultInstanceState==i.Open}function w(e){for(var t=S(e.target.id),n=t.element.open,o=0,r=t.toggles;o<r.length;o++){var i=r[o];i.classList.contains("details-toggle-control")&&(i.classList.add(n?"collapser":"expander"),i.classList.remove(n?"expander":"collapser"))}}function C(e){var t=e.getAttribute("data-details-id");if(!t)throw new Error("element with class "+e+" has no 'data-details-id' attribute!");return t}function L(e){var t=S(C(e)).element;t.open=!t.open}var M="local-details-config:";function I(){return M+document.location.pathname}function E(){for(var e=[],t=0;t<localStorage.length;++t){var n=localStorage.key(t);null!==n&&n.startsWith(M)&&e.push(n)}e.forEach(function(e){localStorage.removeItem(e)})}function O(){if(u.rememberToggles){var e=Array.prototype.slice.call(document.getElementsByClassName("instances details-toggle details-toggle-control")),n=[];e.forEach(function(e){var t=C(e);document.getElementById(t).open!=x()&&n.push(t)});var t=JSON.stringify(n);try{localStorage.setItem(I(),t)}catch(e){}}}function A(){switch(u.defaultInstanceState){case i.Closed:N(!0);break;case i.Open:N(!1)}}function T(e){e.preventDefault(),L(e.currentTarget),O()}function N(o){var e=document.getElementsByClassName("subs instances");[].forEach.call(e,function(e){var t=o?"collapser":"expander",n=e.getElementsByClassName("instances "+t)[0];n&&L(n)})}function P(){N(!0),O()}function j(){N(!1),O()}n.init=function(e){!function(){for(var e=0,t=Array.prototype.slice.call(document.getElementsByTagName("details"));e<t.length;e++){var n=t[e];"string"==typeof n.id&&0<n.id.length&&(k[n.id]={element:n,toggles:[]},n.addEventListener("toggle",w))}}(),Array.prototype.slice.call(document.getElementsByClassName("details-toggle")).forEach(function(e){var t=S(C(e));t.toggles.push(e),e.addEventListener("click",T),e.classList.contains("details-toggle-control")&&e.classList.add(t.element.open?"collapser":"expander")}),function(){if(g(),A(),u.rememberToggles){var e=localStorage.getItem(I());if(e)try{JSON.parse(e).forEach(function(e){S(e).element.open=!x()})}catch(e){if(!(e instanceof SyntaxError||e instanceof TypeError))throw e;localStorage.removeItem(I())}}}(),a.render(l(p,{showHideTrigger:e||h}),document.body)}},{preact:7}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,r=e("./style-menu"),i=e("./details-helper"),s=e("./quick-jump");o=function(){document.body.classList.add("js-enabled"),r.init(),s.init(),i.init()},"interactive"===document.readyState?o():document.addEventListener("readystatechange",function(){"interactive"===document.readyState&&o()})},{"./details-helper":2,"./quick-jump":4,"./style-menu":5}],4:[function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var i=e("fuse.js"),s=e("preact"),a=s.h,l=s.Component;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(t){return a("li",null,a("a",{href:"#",onClick:function(e){e.preventDefault(),t.onClick()}},t.title))},t}(l);function u(e){var t=document.querySelector("#page-menu"),n=document.createElement("li");t.insertBefore(n,t.firstChild),s.render(a(c,{onClick:e,title:"Quick Jump"}),t,n)}function d(e,t){return t.length<=e?t:t.slice(0,e)}var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.linkIndex=0,e.focusPlease=!1,e.navigatedByKeyboard=!1,e}return r(e,t),e.prototype.componentWillMount=function(){var e,t,n,o,r=this;this.setState({searchString:"",isVisible:!1,expanded:{},activeLinkIndex:-1,moduleResults:[]}),e=this.props.baseUrl+"/doc-index.json",t=function(e){r.setState({fuse:new i(e,{threshold:.25,caseSensitive:!0,includeScore:!0,tokenize:!0,keys:[{name:"name",weight:.7},{name:"module",weight:.3}]}),moduleResults:[]})},n=function(e){console&&console.error("could not load 'doc-index.json' for searching",e),r.setState({failedLoading:!0})},(o=new XMLHttpRequest).onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE)if(200===o.status){if(t)try{t(JSON.parse(o.responseText))}catch(e){n(o)}}else n&&n(o)},o.open("GET",e,!0),o.send(),document.addEventListener("mousedown",this.hide.bind(this)),document.addEventListener("keydown",function(e){r.state.isVisible&&("Escape"===e.key?r.hide():"ArrowUp"===e.key||"k"===e.key&&e.ctrlKey?(e.preventDefault(),r.navigateLinks(-1)):"ArrowDown"===e.key||"j"===e.key&&e.ctrlKey?(e.preventDefault(),r.navigateLinks(1)):"Enter"===e.key&&0<=r.state.activeLinkIndex&&r.followActiveLink()),"s"===e.key&&"input"!==e.target.tagName.toLowerCase()&&(e.preventDefault(),r.show())})},e.prototype.hide=function(){this.setState({isVisible:!1,searchString:""})},e.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},e.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},e.prototype.navigateLinks=function(e){var t=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+e));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:t})},e.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},e.prototype.updateResults=function(){var e=this.input&&this.input.value||"",t=this.state.fuse.search(e),o={};t.forEach(function(e){var t=e.item.module;(o[t]||(o[t]=[])).push(e)});var r=[],n=function(e){var t=o[e],n=0;t.forEach(function(e){n+=1/e.score}),r.push({module:e,totalScore:1/n,items:t})};for(var i in o)n(i);r.sort(function(e,t){return e.totalScore-t.totalScore}),this.setState({searchString:e,isVisible:!0,moduleResults:r})},e.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var e=this.activeLink.getClientRects()[0],t=this.searchResults.getClientRects()[0].top;e.bottom>window.innerHeight?this.searchResults.scrollTop+=e.bottom-window.innerHeight+80:e.top<t&&(this.searchResults.scrollTop-=t-e.top+80)}this.focusPlease&&this.input&&this.input.focus(),this.navigatedByKeyboard=!1,this.focusPlease=!1},e.prototype.componentDidMount=function(){this.props.showHideTrigger(this.toggleVisibility.bind(this))},e.prototype.render=function(e,t){var r=this;if(t.failedLoading){var n="file:"==window.location.protocol;return a("div",{id:"search",class:t.isVisible?"":"hidden"},a("div",{id:"search-results"},a("p",{class:"error"},"Failed to load file 'doc-index.json' containing definitions in this package."),n?a("p",{class:"error"},"To use quick jump, load this page with HTTP (from a local static file web server) instead of using the ",a("code",null,"file://")," protocol. (For security reasons, it is not possible to fetch auxiliary files using JS in a HTML page opened with ",a("code",null,"file://"),".)"):[]))}this.linkIndex=0;var o=function(e){e.stopPropagation()},i=d(10,t.moduleResults).map(function(e){return r.renderResultsInModule(e)});return a("div",{id:"search",class:t.isVisible?"":"hidden"},a("div",{id:"search-form",onMouseDown:o},a("input",{placeholder:"Search in package by name",ref:function(e){r.input=e},onFocus:this.show.bind(this),onClick:this.show.bind(this),onInput:this.updateResults.bind(this)})),a("div",{id:"search-results",ref:function(e){r.searchResults=e},onMouseDown:o,onMouseOver:function(e){for(var t=e.target;t&&"function"==typeof t.getAttribute;){var n=t.getAttribute("data-link-index");if("string"==typeof n){var o=parseInt(n,10);r.setState({activeLinkIndex:o});break}t=t.parentNode}}},""===t.searchString?[a(v,null),a(f,null)]:0==i.length?a(g,{searchString:t.searchString}):a("ul",null,i)))},e.prototype.renderResultsInModule=function(e){var n=this,t=e.items,o=e.module,r=this.state.expanded[o]||t.length<=10,i=r?t:d(8,t);return a("li",{class:"search-module"},a("h4",null,o),a("ul",null,i.map(function(e){return t=e.item,a("li",{class:"search-result"},n.navigationLink(n.props.baseUrl+"/"+t.link,{},a(p,{html:t.display_html})));var t}),r?[]:a("li",{class:"more-results"},this.actionLink(function(){var e=Object.assign({},n.state.expanded);e[o]=!0,n.setState({expanded:e})},{},"show "+(t.length-i.length)+" more results from this module"))))},e.prototype.navigationLink=function(e,t){for(var n=this,o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var i=Object.assign({href:e,onClick:this.hide.bind(this)},t);return this.menuLink.apply(this,[i,function(){window.location.href=e,n.hide()}].concat(o))},e.prototype.actionLink=function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=Object.assign({href:"#",onClick:function(e){e.preventDefault(),t()}},e);return this.menuLink.apply(this,[r,t].concat(n))},e.prototype.menuLink=function(e,t){for(var n=this,o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var i=this.linkIndex;i===this.state.activeLinkIndex&&(e.class=(e.class?e.class+" ":"")+"active-link",e.ref=function(e){e&&(n.activeLink=e)},this.activeLinkAction=t);var s=Object.assign({"data-link-index":i},e);return this.linkIndex+=1,a.apply(void 0,["a",s].concat(o))},e}(l),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shouldComponentUpdate=function(e){return this.props.html!==e.html},t.prototype.render=function(e){return a("div",{dangerouslySetInnerHTML:{__html:e.html}})},t}(l);function f(){return a("table",{class:"keyboard-shortcuts"},a("tr",null,a("th",null,"Key"),a("th",null,"Shortcut")),a("tr",null,a("td",null,a("span",{class:"key"},"s")),a("td",null,"Open this search box")),a("tr",null,a("td",null,a("span",{class:"key"},"esc")),a("td",null,"Close this search box")),a("tr",null,a("td",null,a("span",{class:"key"},"↓"),",",a("span",{class:"key"},"ctrl")," + ",a("span",{class:"key"},"j")),a("td",null,"Move down in search results")),a("tr",null,a("td",null,a("span",{class:"key"},"↑"),",",a("span",{class:"key"},"ctrl")," + ",a("span",{class:"key"},"k")),a("td",null,"Move up in search results")),a("tr",null,a("td",null,a("span",{class:"key"},"↵")),a("td",null,"Go to active search result")))}function v(){return a("p",null,"You can find any exported type, constructor, class, function or pattern defined in this package by (approximate) name.")}function g(e){var t=[a("p",null,"Your search for '",e.searchString,"' produced the following list of results: ",a("code",null,"[]"),"."),a("p",null,a("code",null,"Nothing")," matches your query for '",e.searchString,"'."),a("p",null,a("code",null,"Left \"no matches for '",e.searchString,"'\" :: Either String (NonEmpty SearchResult)"))];return t[(e.searchString||"a").charCodeAt(0)%t.length]}function m(e,t){s.render(a(h,{baseUrl:e||".",showHideTrigger:t||u}),document.body)}n.init=m,window.quickNav={init:m}},{"fuse.js":6,preact:7}],5:[function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var i=e("./cookies"),s=e("preact"),a=s.h,l=s.Component;function c(){return Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(e){return-1!=e.rel.indexOf("style")&&e.title})}function u(e){for(var t=c(),n=null,o=0;o<t.length;o++){var r=t[o];r.disabled=!0,r.title==e&&(n=r)}n?(n.disabled=!1,i.setCookie("haddock-style",e)):(t[0].disabled=!1,i.clearCookie("haddock-style"))}var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(t){return a("li",null,a("a",{href:"#",onClick:function(e){e.preventDefault(),t.onClick()}},t.title))},t}(l);var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.componentWillMount=function(){var t=this;document.addEventListener("mousedown",this.hide.bind(this)),document.addEventListener("keydown",function(e){t.state.isVisible&&"Escape"===e.key&&t.hide()})},t.prototype.hide=function(){this.setState({isVisible:!1})},t.prototype.show=function(){this.state.isVisible||this.setState({isVisible:!0})},t.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},t.prototype.componentDidMount=function(){this.props.showHideTrigger(this.toggleVisibility.bind(this))},t.prototype.render=function(e,t){var n=this;return a("div",{id:"style",class:t.isVisible?"":"hidden"},a("div",{id:"style-menu",class:"dropdown-menu",onMouseDown:function(e){e.stopPropagation()}},e.styles.map(function(t){return a("button",{type:"button",onClick:function(e){n.hide(),u(t)}},t)})))},t}(l);n.init=function(e){var t,n=c().map(function(e){return e.title});(t=i.getCookie("haddock-style"))&&u(t),s.render(a(h,{showHideTrigger:e||function(e){return function(e,t){if(1<e.length){var n=document.querySelector("#page-menu"),o=document.createElement("li");n.appendChild(o),s.render(a(d,{onClick:t,title:"Styles"}),n,o)}}(n,e)},styles:n}),document.body)}},{"./cookies":1,preact:7}],6:[function(e,t,n){var o,r;o=this,r=function(){return function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=n,r.c=o,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,n){"use strict";e.exports=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var o=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var u=n(5),d=n(7),_=n(4),r=function(){function y(e,t){var n=t.location,o=void 0===n?0:n,r=t.distance,i=void 0===r?100:r,s=t.threshold,a=void 0===s?.6:s,l=t.maxPatternLength,c=void 0===l?32:l,u=t.isCaseSensitive,d=void 0!==u&&u,h=t.tokenSeparator,p=void 0===h?/ +/g:h,f=t.findAllMatches,v=void 0!==f&&f,g=t.minMatchCharLength,m=void 0===g?1:g;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),this.options={location:o,distance:i,threshold:a,maxPatternLength:c,isCaseSensitive:d,tokenSeparator:p,findAllMatches:v,minMatchCharLength:m},this.pattern=this.options.isCaseSensitive?e:e.toLowerCase(),this.pattern.length<=c&&(this.patternAlphabet=_(this.pattern))}return o(y,[{key:"search",value:function(e){if(this.options.isCaseSensitive||(e=e.toLowerCase()),this.pattern===e)return{isMatch:!0,score:0,matchedIndices:[[0,e.length-1]]};var t=this.options,n=t.maxPatternLength,o=t.tokenSeparator;if(this.pattern.length>n)return u(e,this.pattern,o);var r=this.options,i=r.location,s=r.distance,a=r.threshold,l=r.findAllMatches,c=r.minMatchCharLength;return d(e,this.pattern,this.patternAlphabet,{location:i,distance:s,threshold:a,findAllMatches:l,minMatchCharLength:c})}}]),y}();e.exports=r},function(e,t,n){"use strict";var u=n(0);e.exports=function(e,t){return function e(t,n,o){if(n){var r=n.indexOf("."),i=n,s=null;-1!==r&&(i=n.slice(0,r),s=n.slice(r+1));var a=t[i];if(null!=a)if(s||"string"!=typeof a&&"number"!=typeof a)if(u(a))for(var l=0,c=a.length;l<c;l+=1)e(a[l],s,o);else s&&e(a,s,o);else o.push(a.toString())}else o.push(t);return o}(e,t,[])}},function(e,t,n){"use strict";e.exports=function(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=e.length;i<s;i+=1){var a=e[i];a&&-1===o?o=i:a||-1===o||(t<=(r=i-1)-o+1&&n.push([o,r]),o=-1)}return e[i-1]&&t<=i-o&&n.push([o,i-1]),n}},function(e,t,n){"use strict";e.exports=function(e){for(var t={},n=e.length,o=0;o<n;o+=1)t[e.charAt(o)]=0;for(var r=0;r<n;r+=1)t[e.charAt(r)]|=1<<n-r-1;return t}},function(e,t,n){"use strict";var u=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(u,"\\$&").replace(n,"|")),r=e.match(o),i=!!r,s=[];if(i)for(var a=0,l=r.length;a<l;a+=1){var c=r[a];s.push([e.indexOf(c),c.length-1])}return{score:i?.5:1,isMatch:i,matchedIndices:s}}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.errors,o=void 0===n?0:n,r=t.currentLocation,i=void 0===r?0:r,s=t.expectedLocation,a=void 0===s?0:s,l=t.distance,c=void 0===l?100:l,u=o/e.length,d=Math.abs(a-i);return c?u+d/c:d?1:u}},function(e,t,n){"use strict";var V=n(6),D=n(3);e.exports=function(e,t,n,o){for(var r=o.location,i=void 0===r?0:r,s=o.distance,a=void 0===s?100:s,l=o.threshold,c=void 0===l?.6:l,u=o.findAllMatches,d=void 0!==u&&u,h=o.minMatchCharLength,p=void 0===h?1:h,f=i,v=e.length,g=c,m=e.indexOf(t,f),y=t.length,_=[],b=0;b<v;b+=1)_[b]=0;if(-1!==m){var k=V(t,{errors:0,currentLocation:m,expectedLocation:f,distance:a});if(g=Math.min(k,g),-1!==(m=e.lastIndexOf(t,f+y))){var S=V(t,{errors:0,currentLocation:m,expectedLocation:f,distance:a});g=Math.min(S,g)}}m=-1;for(var x=[],w=1,C=y+v,L=1<<y-1,M=0;M<y;M+=1){for(var I=0,E=C;I<E;){V(t,{errors:M,currentLocation:f+E,expectedLocation:f,distance:a})<=g?I=E:C=E,E=Math.floor((C-I)/2+I)}C=E;var O=Math.max(1,f-E+1),A=d?v:Math.min(f+E,v)+y,T=Array(A+2);T[A+1]=(1<<M)-1;for(var N=A;O<=N;N-=1){var P=N-1,j=n[e.charAt(P)];if(j&&(_[P]=1),T[N]=(T[N+1]<<1|1)&j,0!==M&&(T[N]|=(x[N+1]|x[N])<<1|1|x[N+1]),T[N]&L&&(w=V(t,{errors:M,currentLocation:P,expectedLocation:f,distance:a}))<=g){if(g=w,(m=P)<=f)break;O=Math.max(1,2*f-m)}}if(g<V(t,{errors:M+1,currentLocation:f,expectedLocation:f,distance:a}))break;x=T}return{isMatch:0<=m,score:0===w?.001:w,matchedIndices:D(_,p)}}},function(e,t,n){"use strict";var o=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}();var i=n(1),R=n(2),V=n(0),r=function(){function U(e,t){var n=t.location,o=void 0===n?0:n,r=t.distance,i=void 0===r?100:r,s=t.threshold,a=void 0===s?.6:s,l=t.maxPatternLength,c=void 0===l?32:l,u=t.caseSensitive,d=void 0!==u&&u,h=t.tokenSeparator,p=void 0===h?/ +/g:h,f=t.findAllMatches,v=void 0!==f&&f,g=t.minMatchCharLength,m=void 0===g?1:g,y=t.id,_=void 0===y?null:y,b=t.keys,k=void 0===b?[]:b,S=t.shouldSort,x=void 0===S||S,w=t.getFn,C=void 0===w?R:w,L=t.sortFn,M=void 0===L?function(e,t){return e.score-t.score}:L,I=t.tokenize,E=void 0!==I&&I,O=t.matchAllTokens,A=void 0!==O&&O,T=t.includeMatches,N=void 0!==T&&T,P=t.includeScore,j=void 0!==P&&P,V=t.verbose,D=void 0!==V&&V;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,U),this.options={location:o,distance:i,threshold:a,maxPatternLength:c,isCaseSensitive:d,tokenSeparator:p,findAllMatches:v,minMatchCharLength:m,id:_,keys:k,includeMatches:N,includeScore:j,shouldSort:x,getFn:C,sortFn:M,verbose:D,tokenize:E,matchAllTokens:A},this.setCollection(e)}return o(U,[{key:"setCollection",value:function(e){return this.list=e}},{key:"search",value:function(e){this._log('---------\nSearch pattern: "'+e+'"');var t=this._prepareSearchers(e),n=t.tokenSearchers,o=t.fullSearcher,r=this._search(n,o),i=r.weights,s=r.results;return this._computeScore(i,s),this.options.shouldSort&&this._sort(s),this._format(s)}},{key:"_prepareSearchers",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),o=0,r=n.length;o<r;o+=1)t.push(new i(n[o],this.options));return{tokenSearchers:t,fullSearcher:new i(e,this.options)}}},{key:"_search",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i<s;i+=1)this._analyze({key:"",value:n[i],record:i,index:i},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t});return{weights:null,results:r}}for(var a={},l=0,c=n.length;l<c;l+=1)for(var u=n[l],d=0,h=this.options.keys.length;d<h;d+=1){var p=this.options.keys[d];if("string"!=typeof p){if(a[p.name]={weight:1-p.weight||1},p.weight<=0||1<p.weight)throw new Error("Key weight has to be > 0 and <= 1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(u,p),record:u,index:l},{resultMap:o,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:"_analyze",value:function(e,t){var n=e.key,o=e.arrayIndex,r=void 0===o?-1:o,i=e.value,s=e.record,a=e.index,l=t.tokenSearchers,c=void 0===l?[]:l,u=t.fullSearcher,d=void 0===u?[]:u,h=t.resultMap,p=void 0===h?{}:h,f=t.results,v=void 0===f?[]:f;if(null!=i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var _=d.search(i);if(this._log('Full text: "'+i+'", score: '+_.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),k=[],S=0;S<c.length;S+=1){var x=c[S];this._log('\nPattern: "'+x.pattern+'"');for(var w=!1,C=0;C<b.length;C+=1){var L=b[C],M=x.search(L),I={};M.isMatch?(I[L]=M.score,w=g=!0,k.push(M.score)):(I[L]=1,this.options.matchAllTokens||k.push(1)),this._log('Token: "'+L+'", score: '+I[L])}w&&(y+=1)}m=k[0];for(var E=k.length,O=1;O<E;O+=1)m+=k[O];m/=E,this._log("Token score average:",m)}var A=_.score;-1<m&&(A=(A+m)/2),this._log("Score average:",A);var T=!this.options.tokenize||!this.options.matchAllTokens||y>=c.length;if(this._log("\nCheck Matches: "+T),(g||_.isMatch)&&T){var N=p[a];N?N.output.push({key:n,arrayIndex:r,value:i,score:A,matchedIndices:_.matchedIndices}):(p[a]={item:s,output:[{key:n,arrayIndex:r,value:i,score:A,matchedIndices:_.matchedIndices}]},v.push(p[a]))}}else if(V(i))for(var P=0,j=i.length;P<j;P+=1)this._analyze({key:n,arrayIndex:P,value:i[P],record:s,index:a},{resultMap:p,results:v,tokenSearchers:c,fullSearcher:d})}}},{key:"_computeScore",value:function(e,t){this._log("\n\nComputing score:\n");for(var n=0,o=t.length;n<o;n+=1){for(var r=t[n].output,i=r.length,s=1,a=1,l=0;l<i;l+=1){var c=e?e[r[l].key].weight:1,u=(1===c?r[l].score:r[l].score||.001)*c;1!==c?a=Math.min(a,u):s*=r[l].nScore=u}t[n].score=1===a?s:a,this._log(t[n])}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];this.options.verbose&&this._log("\n\nOutput:\n\n",JSON.stringify(e));var n=[];this.options.includeMatches&&n.push(function(e,t){var n=e.output;t.matches=[];for(var o=0,r=n.length;o<r;o+=1){var i=n[o];if(0!==i.matchedIndices.length){var s={indices:i.matchedIndices,value:i.value};i.key&&(s.key=i.key),i.hasOwnProperty("arrayIndex")&&-1<i.arrayIndex&&(s.arrayIndex=i.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var o=0,r=e.length;o<r;o+=1){var i=e[o];if(this.options.id&&(i.item=this.options.getFn(i.item,this.options.id)[0]),n.length){for(var s={item:i.item},a=0,l=n.length;a<l;a+=1)n[a](i,s);t.push(s)}else t.push(i.item)}return t}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments)}}]),U}();e.exports=r}])},"object"==typeof n&&"object"==typeof t?t.exports=r():"function"==typeof define&&define.amd?define("Fuse",[],r):"object"==typeof n?n.Fuse=r():o.Fuse=r()},{}],7:[function(e,y,t){!function(){"use strict";function n(e,t){var n,o,r,i,s=d;for(i=arguments.length;2<i--;)u.push(arguments[i]);for(t&&null!=t.children&&(u.length||u.push(t.children),delete t.children);u.length;)if((o=u.pop())&&void 0!==o.pop)for(i=o.length;i--;)u.push(o[i]);else"boolean"==typeof o&&(o=null),(r="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(r=!1)),r&&n?s[s.length-1]+=o:s===d?s=[o]:s.push(o),n=r;var a=new c;return a.nodeName=e,a.children=s,a.attributes=null==t?void 0:t,a.key=null==t?void 0:t.key,void 0!==D.vnode&&D.vnode(a),a}function L(e,t){for(var n in t)e[n]=t[n];return e}function i(e){!e.__d&&(e.__d=!0)&&1==p.push(e)&&(D.debounceRendering||r)(t)}function t(){var e,t=p;for(p=[];e=t.pop();)e.__d&&j(e)}function C(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function M(e){var t=L({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function I(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===h.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,l,s):e.removeEventListener(t,l,s),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e){try{e[t]=null==o?"":o}catch(e){}null!=o&&!1!==o||"spellcheck"==t||e.removeAttribute(t)}else{var a=r&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function l(e){return this.__l[e.type](D.event&&D.event(e)||e)}function E(){for(var e;e=U.pop();)D.afterMount&&D.afterMount(e),e.componentDidMount&&e.componentDidMount()}function O(e,t,n,o,r,i){R++||(g=null!=r&&void 0!==r.ownerSVGElement,m=null!=e&&!("__preactattr_"in e));var s=A(e,t,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(m=!1,i||E()),s}function A(e,t,n,o,r){var i=e,s=g;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),T(e,!0))),i.__preactattr_=!0,i;var a,l,c=t.nodeName;if("function"==typeof c)return function(e,t,n,o){var r=e&&e._component,i=r,s=e,a=r&&e._componentConstructor===t.nodeName,l=a,c=M(t);for(;r&&!l&&(r=r.__u);)l=r.constructor===t.nodeName;r&&l&&(!o||r._component)?(P(r,c,3,n,o),e=r.base):(i&&!a&&(V(i),e=s=null),r=N(t.nodeName,c,n),e&&!r.__b&&(r.__b=e,s=null),P(r,c,1,n,o),e=r.base,s&&e!==s&&(s._component=null,T(s,!1)));return e}(e,t,n,o);if(g="svg"===c||"foreignObject"!==c&&g,c=String(c),(!e||!C(e,c))&&(a=c,(l=g?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).__n=a,i=l,e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),T(e,!0)}var u=i.firstChild,d=i.__preactattr_,h=t.children;if(null==d){d=i.__preactattr_={};for(var p=i.attributes,f=p.length;f--;)d[p[f].name]=p[f].value}return!m&&h&&1===h.length&&"string"==typeof h[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=h[0]&&(u.nodeValue=h[0]):(h&&h.length||null!=u)&&function(e,t,n,o,r){var i,s,a,l,c,u=e.childNodes,d=[],h={},p=0,f=0,v=u.length,g=0,m=t?t.length:0;if(0!==v)for(var y=0;y<v;y++){var _=u[y],b=_.__preactattr_,k=m&&b?_._component?_._component.__k:b.key:null;null!=k?(p++,h[k]=_):(b||(void 0!==_.splitText?!r||_.nodeValue.trim():r))&&(d[g++]=_)}if(0!==m)for(var y=0;y<m;y++){l=t[y],c=null;var k=l.key;if(null!=k)p&&void 0!==h[k]&&(c=h[k],h[k]=void 0,p--);else if(f<g)for(i=f;i<g;i++)if(void 0!==d[i]&&(S=s=d[i],w=r,"string"==typeof(x=l)||"number"==typeof x?void 0!==S.splitText:"string"==typeof x.nodeName?!S._componentConstructor&&C(S,x.nodeName):w||S._componentConstructor===x.nodeName)){c=s,d[i]=void 0,i===g-1&&g--,i===f&&f++;break}c=A(c,l,n,o),a=u[y],c&&c!==e&&c!==a&&(null==a?e.appendChild(c):c===a.nextSibling?I(a):e.insertBefore(c,a))}var S,x,w;if(p)for(var y in h)void 0!==h[y]&&T(h[y],!1);for(;f<=g;)void 0!==(c=d[g--])&&T(c,!1)}(i,h,n,o,m||null!=d.dangerouslySetInnerHTML),function(e,t,n){var o;for(o in n)t&&null!=t[o]||null==n[o]||v(e,o,n[o],n[o]=void 0,g);for(o in t)"children"===o||"innerHTML"===o||o in n&&t[o]===("value"===o||"checked"===o?e[o]:n[o])||v(e,o,n[o],n[o]=t[o],g)}(i,t.attributes,d),g=s,i}function T(e,t){var n=e._component;n?V(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||I(e),o(e))}function o(e){for(e=e.lastChild;e;){var t=e.previousSibling;T(e,!0),e=t}}function N(e,t,n){var o,r=f.length;for(e.prototype&&e.prototype.render?(o=new e(t,n),a.call(o,t,n)):((o=new a(t,n)).constructor=e,o.render=s);r--;)if(f[r].constructor===e)return o.__b=f[r].__b,f.splice(r,1),o;return o}function s(e,t,n){return this.constructor(e,n)}function P(e,t,n,o,r){e.__x||(e.__x=!0,e.__r=t.ref,e.__k=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||r?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o)),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===D.syncComponentUpdates&&e.base?i(e):j(e,1,r)),e.__r&&e.__r(e))}function j(e,t,n,o){if(!e.__x){var r,i,s,a=e.props,l=e.state,c=e.context,u=e.__p||a,d=e.__s||l,h=e.__c||c,p=e.base,f=e.__b,v=p||f,g=e._component,m=!1,y=h;if(e.constructor.getDerivedStateFromProps&&(l=L(L({},l),e.constructor.getDerivedStateFromProps(a,l)),e.state=l),p&&(e.props=u,e.state=d,e.context=h,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(a,l,c)?m=!0:e.componentWillUpdate&&e.componentWillUpdate(a,l,c),e.props=a,e.state=l,e.context=c),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!m){r=e.render(a,l,c),e.getChildContext&&(c=L(L({},c),e.getChildContext())),p&&e.getSnapshotBeforeUpdate&&(y=e.getSnapshotBeforeUpdate(u,d));var _,b,k=r&&r.nodeName;if("function"==typeof k){var S=M(r);(i=g)&&i.constructor===k&&S.key==i.__k?P(i,S,1,c,!1):(_=i,e._component=i=N(k,S,c),i.__b=i.__b||f,i.__u=e,P(i,S,0,c,!1),j(i,1,n,!0)),b=i.base}else s=v,(_=g)&&(s=e._component=null),(v||1===t)&&(s&&(s._component=null),b=O(s,r,c,n||!p,v&&v.parentNode,!0));if(v&&b!==v&&i!==g){var x=v.parentNode;x&&b!==x&&(x.replaceChild(b,v),_||(v._component=null,T(v,!1)))}if(_&&V(_),(e.base=b)&&!o){for(var w=e,C=e;C=C.__u;)(w=C).base=b;b._component=w,b._componentConstructor=w.constructor}}for(!p||n?U.unshift(e):m||(e.componentDidUpdate&&e.componentDidUpdate(u,d,y),D.afterUpdate&&D.afterUpdate(e));e.__h.length;)e.__h.pop().call(e);R||o||E()}}function V(e){D.beforeUnmount&&D.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?V(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),I(e.__b=t),f.push(e),o(t)),e.__r&&e.__r(null)}function a(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{},this.__h=[]}var c=function(){},D={},u=[],d=[],r="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,h=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,p=[],U=[],R=0,g=!1,m=!1,f=[];L(a.prototype,{setState:function(e,t){this.__s||(this.__s=this.state),this.state=L(L({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this.__h.push(t),i(this)},forceUpdate:function(e){e&&this.__h.push(e),j(this,2)},render:function(){}});var e={h:n,createElement:n,cloneElement:function(e,t){return n(e.nodeName,L(L({},e.attributes),t),2<arguments.length?[].slice.call(arguments,2):e.children)},Component:a,render:function(e,t,n){return O(n,e,{},!1,t,!1)},rerender:t,options:D};void 0!==y?y.exports=e:self.preact=e}()},{}]},{},[3]); //# sourceMappingURL=haddock-bundle.min.js.map diff --git a/haddock-api/resources/html/js-src/details-helper.ts b/haddock-api/resources/html/js-src/details-helper.ts deleted file mode 100644 index f13ac905..00000000 --- a/haddock-api/resources/html/js-src/details-helper.ts +++ /dev/null @@ -1,106 +0,0 @@ -import {getCookie} from "./cookies"; - -interface HTMLDetailsElement extends HTMLElement { - open: boolean -} - -interface DetailsInfo { - element: HTMLDetailsElement - openByDefault: boolean - toggles: HTMLElement[] -} - -// Global state -const detailsRegistry: { [id: string]: DetailsInfo } = {}; -const toggled: { [id: string]: true } = {}; /* stores which <details> are not in their default state */ - -function lookupDetailsRegistry(id: string): DetailsInfo { - const info = detailsRegistry[id]; - if (info == undefined) { throw new Error(`could not find <details> element with id '${id}'`); } - return info; -} - -function onDetailsToggle(ev: Event) { - const element = ev.target as HTMLDetailsElement; - const id = element.id; - const info = lookupDetailsRegistry(id); - const isOpen = info.element.open; - for (const toggle of info.toggles) { - if (toggle.classList.contains('details-toggle-control')) { - toggle.classList.add(isOpen ? 'collapser' : 'expander'); - toggle.classList.remove(isOpen ? 'expander' : 'collapser'); - } - } - if (element.open == info.openByDefault) { - delete toggled[id]; - } else { - toggled[id] = true; - } - rememberToggled(); -} - -function gatherDetailsElements() { - const els: HTMLDetailsElement[] = Array.prototype.slice.call(document.getElementsByTagName('details')); - for (const el of els) { - if (typeof el.id == "string" && el.id.length > 0) { - detailsRegistry[el.id] = { - element: el, - openByDefault: !!el.open, - toggles: [] // added later - }; - el.addEventListener('toggle', onDetailsToggle); - } - } -} - -function toggleDetails(id: string) { - const {element} = lookupDetailsRegistry(id); - element.open = !element.open; -} - -function rememberToggled() { - const sections: string[] = Object.keys(toggled); - // cookie specific to this page; don't use setCookie which sets path=/ - document.cookie = "toggled=" + encodeURIComponent(sections.join('+')); -} - -function restoreToggled() { - const cookie = getCookie("toggled"); - if (!cookie) { return; } - const ids = cookie.split('+'); - for (const id of ids) { - const info = detailsRegistry[id]; - toggled[id] = true; - if (info) { - info.element.open = !info.element.open; - } - } -} - -function onToggleClick(ev: MouseEvent) { - ev.preventDefault(); - const toggle = ev.currentTarget as HTMLElement; - const id = toggle.getAttribute('data-details-id'); - if (!id) { throw new Error("element with class 'details-toggle' has no 'data-details-id' attribute!"); } - toggleDetails(id); -} - -function initCollapseToggles() { - const toggles: HTMLElement[] = Array.prototype.slice.call(document.getElementsByClassName('details-toggle')); - toggles.forEach(toggle => { - const id = toggle.getAttribute('data-details-id'); - if (!id) { throw new Error("element with class 'details-toggle' has no 'data-details-id' attribute!"); } - const info = lookupDetailsRegistry(id); - info.toggles.push(toggle); - toggle.addEventListener('click', onToggleClick); - if (toggle.classList.contains('details-toggle-control')) { - toggle.classList.add(info.element.open ? 'collapser' : 'expander'); - } - }); -} - -export function init() { - gatherDetailsElements(); - restoreToggled(); - initCollapseToggles(); -}
\ No newline at end of file diff --git a/haddock-api/resources/html/js-src/details-helper.tsx b/haddock-api/resources/html/js-src/details-helper.tsx new file mode 100644 index 00000000..871b5417 --- /dev/null +++ b/haddock-api/resources/html/js-src/details-helper.tsx @@ -0,0 +1,464 @@ +// This file implements the UI and logic for collapsing and expanding +// instance lists ("details"). +// +// A configuration ('GlobalConfig') controlled by the UI is persisted +// in local storage in the user's browser. The configuration includes: +// +// * a global default state ('defaultInstanceState') for all instance +// lists. The possible values for the global default are "collapsed" +// and "expanded". +// +// * a global boolean option ('rememberToggles') to remember which +// specific instance lists are not in the default state (e.g. which +// instance lists are expanded when the default is "collapsed"). +// +// * a local / per-page record of which specific instance lists are +// not in the default state, when the global option +// ('rememberToggles') to remember this info is enabled. +// +// The UI consists of an Instances menu with buttons for expanding and +// collapsing all instance lists in the current module, a checkbox for +// setting the global default state, and a checkbox to enable +// remembering which instance lists are not in the global default +// state. Also, each instance list on each module page has buttons for +// collapsing and expanding. +// +// The logic of the UI is as follows: +// +// * setting the global default state erases any record of which +// specific instances are in the non-default state, and collapses or +// expands all instance lists on the current page to be in the +// global default state. +// +// * changing boolean option for remembering which specific instance +// lists are not in the default state erases any existing record of +// which instances are not in the default state across all pages, +// and updates the record for the current page when the option is +// set to true. No collapsing or expanding is done. +// +// * toggling the collapse/expand state of a specific instance list +// causes the state of that specific instance list to be recorded in +// the persisted configuration iff the new state of that specific +// instance list is different from the global default state, and the +// option to remember instance list states is enabled. There are two +// ways to toggle the collapse/expand state of a specific instance, +// by clicking its collapse/expand button, and by clicking the +// "collapse all" or "expand all" button in the Instances menu. +// +// This file also implements an association between elements (with +// class "details-toggle" and "details-toggle-control") that can be +// clicked to expand/collapse <details> elements, and the details +// elements themselves. Note that this covers both <details> elements +// that list instances -- what the above explained UI and logic is +// concerned with -- and details about individual instances themselves +// -- which the above is not concerend with. The association includes +// adding event listeners that change CSS classes back and forth +// between "expander" and "collapser"; these classes determine whether +// an element is adorned with a right arrow ("expander") or a down +// arrow ("collapser"). I don't understand why we don't directly use +// the the HTML <summary> element type to allow the <details> elements +// to be directly clickable. +import preact = require("preact"); + +const { h, Component } = preact; + +enum DefaultState { Closed, Open } + +interface GlobalConfig { + defaultInstanceState: DefaultState + rememberToggles: boolean +} + +// Hackage domain-wide config +const globalConfig: GlobalConfig = { + defaultInstanceState: DefaultState.Open, + rememberToggles: true, +}; + +class PreferencesButton extends Component<any, any> { + render(props: { title: string, onClick: () => void }) { + function onClick(e: Event) { + e.preventDefault(); + props.onClick(); + } + return <li><a href="#" onClick={onClick}>{props.title}</a></li>; + } +} + +function addPreferencesButton(action: () => void) { + const pageMenu = document.querySelector('#page-menu') as HTMLUListElement; + const dummy = document.createElement('li'); + pageMenu.insertBefore(dummy, pageMenu.firstChild); + preact.render(<PreferencesButton onClick={action} title="Instances" />, pageMenu, dummy); +} + +type PreferencesProps = { + showHideTrigger: (action: () => void) => void +} + +type PreferencesState = { + isVisible: boolean +} + +class Preferences extends Component<PreferencesProps, PreferencesState> { + componentWillMount() { + document.addEventListener('mousedown', this.hide.bind(this)); + + document.addEventListener('keydown', (e) => { + if (this.state.isVisible) { + if (e.key === 'Escape') { + this.hide(); + } + } + }) + } + + hide() { + this.setState({ isVisible: false }); + } + + show() { + if (!this.state.isVisible) { + this.setState({ isVisible: true }); + } + } + + toggleVisibility() { + if (this.state.isVisible) { + this.hide(); + } else { + this.show(); + } + } + + componentDidMount() { + this.props.showHideTrigger(this.toggleVisibility.bind(this)); + } + + render(props: PreferencesProps, state: PreferencesState) { + const stopPropagation = (e: Event) => { e.stopPropagation(); }; + + return <div id="preferences" class={state.isVisible ? '' : 'hidden'}> + <div id="preferences-menu" class="dropdown-menu" onMouseDown={stopPropagation}> + <PreferencesMenu /> + </div> + </div>; + } +} + +function storeGlobalConfig() { + const json = JSON.stringify(globalConfig); + try { + // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions. + localStorage.setItem('global', json); + } catch (e) {} +} + +var globalConfigLoaded: boolean = false; + +function loadGlobalConfig() { + if (globalConfigLoaded) { return; } + globalConfigLoaded = true; + const global = localStorage.getItem('global'); + if (!global) { return; } + try { + const globalConfig_ = JSON.parse(global); + globalConfig.defaultInstanceState = globalConfig_.defaultInstanceState; + globalConfig.rememberToggles = globalConfig_.rememberToggles; + } catch(e) { + // Gracefully handle errors related to changed config format. + if (e instanceof SyntaxError || e instanceof TypeError) { + localStorage.removeItem('global'); + } else { + throw e; + } + } +} + +function setDefaultInstanceState(s: DefaultState) { + return (e: Event) => { + globalConfig.defaultInstanceState = s; + putInstanceListsInDefaultState(); + storeGlobalConfig(); + clearLocalStorage(); + storeLocalConfig(); + } +} + +function setRememberToggles(e: Event) { + const checked: boolean = (e as any).target.checked; + globalConfig.rememberToggles = checked; + storeGlobalConfig(); + clearLocalStorage(); + storeLocalConfig(); +} + +// Click event consumer for "default collapse" instance menu check box. +function defaultCollapseOnClick(e: Event) { + const us = document.getElementById('default-collapse-instances') as HTMLInputElement; + if (us !== null) { + if (us.checked) { + setDefaultInstanceState(DefaultState.Closed)(e); + } else { + setDefaultInstanceState(DefaultState.Open)(e); + } + } +} + +// Instances menu. +function PreferencesMenu() { + loadGlobalConfig(); + return <div> + <div> + <button type="button" + onClick={expandAllInstances}> + Expand All Instances + </button> + <button type="button" + onClick={collapseAllInstances}> + Collapse All Instances + </button> + </div> + <div> + <input type="checkbox" + id="default-collapse-instances" + name="default-instance-state" + checked={globalConfig.defaultInstanceState===DefaultState.Closed} + onClick={defaultCollapseOnClick}></input> + + <span>Collapse All Instances By Default</span> + </div> + <div> + <input type="checkbox" + id="remember-toggles" + name="remember-toggles" + checked={globalConfig.rememberToggles} + onClick={setRememberToggles}></input> + <label for="remember-toggles">Remember Manually Collapsed/Expanded Instances</label> + </div> + </div>; +} + +interface HTMLDetailsElement extends HTMLElement { + open: boolean +} + +interface DetailsInfo { + element: HTMLDetailsElement + // Here 'toggles' is the list of all elements of class + // 'details-toggle-control' that control toggling 'element'. I + // believe this list is always length zero or one. + toggles: HTMLElement[] +} + +// Mapping from <details> elements to their info. +const detailsRegistry: { [id: string]: DetailsInfo } = {}; + +function lookupDetailsRegistry(id: string): DetailsInfo { + const info = detailsRegistry[id]; + if (info == undefined) { throw new Error(`could not find <details> element with id '${id}'`); } + return info; +} + +// Return true iff instance lists are open by default. +function getDefaultOpenSetting(): boolean { + return globalConfig.defaultInstanceState == DefaultState.Open; +} + +// Event handler for "toggle" events, which are triggered when a +// <details> element's "open" property changes. We don't deal with +// any config stuff here, because we only change configs in response +// to mouse clicks. In contrast, for example, this event is triggred +// automatically once for every <details> element when the user clicks +// the "collapse all elements" button. +function onToggleEvent(ev: Event) { + const element = ev.target as HTMLDetailsElement; + const id = element.id; + const info = lookupDetailsRegistry(id); + const isOpen = info.element.open; + // Update the CSS of the toggle element users can click on to toggle + // 'element'. The "collapser" and "expander" classes control what + // kind of arrow appears next to the 'toggle' element. + for (const toggle of info.toggles) { + if (toggle.classList.contains('details-toggle-control')) { + toggle.classList.add(isOpen ? 'collapser' : 'expander'); + toggle.classList.remove(isOpen ? 'expander' : 'collapser'); + } + } +} + +function gatherDetailsElements() { + const els: HTMLDetailsElement[] = Array.prototype.slice.call(document.getElementsByTagName('details')); + for (const el of els) { + if (typeof el.id == "string" && el.id.length > 0) { + detailsRegistry[el.id] = { + element: el, + toggles: [] // Populated later by 'initCollapseToggles'. + }; + el.addEventListener('toggle', onToggleEvent); + } + } +} + +// Return the id of the <details> element that the given 'toggle' +// element toggles. +function getDataDetailsId(toggle: Element): string { + const id = toggle.getAttribute('data-details-id'); + if (!id) { throw new Error("element with class " + toggle + " has no 'data-details-id' attribute!"); } + return id; +} + +// Toggle the "open" state of a <details> element when that element's +// toggle element is clicked. +function toggleDetails(toggle: Element) { + const id = getDataDetailsId(toggle); + const {element} = lookupDetailsRegistry(id); + element.open = !element.open; +} + +// Prefix for local keys used with local storage. Idea is that other +// modules could also use local storage with a different prefix and we +// wouldn't step on each other's toes. +// +// NOTE: we're using the browser's "local storage" API via the +// 'localStorage' object to store both "local" (to the current Haddock +// page) and "global" (across all Haddock pages) configuration. Be +// aware of these two different uses of the term "local". +const localStoragePrefix: string = "local-details-config:"; + +// Local storage key for the current page. +function localStorageKey(): string { + return localStoragePrefix + document.location.pathname; +} + +// Clear all local storage related to instance list configs. +function clearLocalStorage() { + const keysToDelete: string[] = []; + for (var i = 0; i < localStorage.length; ++i) { + const key = localStorage.key(i); + if (key !== null && key.startsWith(localStoragePrefix)) { + keysToDelete.push(key); + } + } + keysToDelete.forEach(key => { + localStorage.removeItem(key); + }); +} + +// Compute and save the set of instance list ids that aren't in the +// default state. +function storeLocalConfig() { + if (!globalConfig.rememberToggles) return; + const instanceListToggles: HTMLElement[] = + // Restrict to 'details-toggle' elements for "instances" + // *plural*. These are the toggles that control instance lists and + // not the list of methods for individual instances. + Array.prototype.slice.call(document.getElementsByClassName( + 'instances details-toggle details-toggle-control')); + const nonDefaultInstanceListIds: string[] = []; + instanceListToggles.forEach(toggle => { + const id = getDataDetailsId(toggle); + const details = document.getElementById(id) as HTMLDetailsElement; + if (details.open != getDefaultOpenSetting()) { + nonDefaultInstanceListIds.push(id); + } + }); + + const json = JSON.stringify(nonDefaultInstanceListIds); + try { + // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions. + localStorage.setItem(localStorageKey(), json); + } catch (e) {} +} + +function putInstanceListsInDefaultState() { + switch (globalConfig.defaultInstanceState) { + case DefaultState.Closed: _collapseAllInstances(true); break; + case DefaultState.Open: _collapseAllInstances(false); break; + default: break; + } +} + +// Expand and collapse instance lists according to global and local +// config. +function restoreToggled() { + loadGlobalConfig(); + putInstanceListsInDefaultState(); + if (!globalConfig.rememberToggles) { return; } + const local = localStorage.getItem(localStorageKey()); + if (!local) { return; } + try { + const nonDefaultInstanceListIds: string[] = JSON.parse(local); + nonDefaultInstanceListIds.forEach(id => { + const info = lookupDetailsRegistry(id); + info.element.open = ! getDefaultOpenSetting(); + }); + } catch(e) { + // Gracefully handle errors related to changed config format. + if (e instanceof SyntaxError || e instanceof TypeError) { + localStorage.removeItem(localStorageKey()); + } else { + throw e; + } + } +} + +// Handler for clicking on the "toggle" element that toggles the +// <details> element with id given by the 'data-details-id' property +// of the "toggle" element. +function onToggleClick(ev: MouseEvent) { + ev.preventDefault(); + const toggle = ev.currentTarget as HTMLElement; + toggleDetails(toggle); + storeLocalConfig(); +} + +// Set event handlers on elements responsible for expanding and +// collapsing <details> elements. +// +// This applies to all 'details-toggle's, not just to to top-level +// 'details-toggle's that control instance lists. +function initCollapseToggles() { + const toggles: HTMLElement[] = Array.prototype.slice.call(document.getElementsByClassName('details-toggle')); + toggles.forEach(toggle => { + const id = getDataDetailsId(toggle); + const info = lookupDetailsRegistry(id); + info.toggles.push(toggle); + toggle.addEventListener('click', onToggleClick); + if (toggle.classList.contains('details-toggle-control')) { + toggle.classList.add(info.element.open ? 'collapser' : 'expander'); + } + }); +} + +// Collapse or expand all instances. +function _collapseAllInstances(collapse: boolean) { + const ilists = document.getElementsByClassName('subs instances'); + [].forEach.call(ilists, function (ilist : Element) { + const toggleType = collapse ? 'collapser' : 'expander'; + const toggle = ilist.getElementsByClassName('instances ' + toggleType)[0]; + if (toggle) { + toggleDetails(toggle); + } + }); +} + +function collapseAllInstances() { + _collapseAllInstances(true); + storeLocalConfig(); +} + +function expandAllInstances() { + _collapseAllInstances(false); + storeLocalConfig(); +} + +export function init(showHide?: (action: () => void) => void) { + gatherDetailsElements(); + initCollapseToggles(); + restoreToggled(); + preact.render( + <Preferences showHideTrigger={showHide || addPreferencesButton} />, + document.body + ); +} diff --git a/haddock-api/resources/html/js-src/init.ts b/haddock-api/resources/html/js-src/init.ts index 877874ae..1bfa8b3c 100644 --- a/haddock-api/resources/html/js-src/init.ts +++ b/haddock-api/resources/html/js-src/init.ts @@ -17,6 +17,6 @@ function onDomReady(callback: () => void) { onDomReady(() => { document.body.classList.add('js-enabled'); styleMenu.init(); - detailsHelper.init(); quickJump.init(); -});
\ No newline at end of file + detailsHelper.init(); +}); diff --git a/haddock-api/resources/html/js-src/style-menu.tsx b/haddock-api/resources/html/js-src/style-menu.tsx index bab840ca..2eb8344e 100644 --- a/haddock-api/resources/html/js-src/style-menu.tsx +++ b/haddock-api/resources/html/js-src/style-menu.tsx @@ -4,91 +4,14 @@ import {getCookie, setCookie, clearCookie} from "./cookies"; import preact = require("preact"); const { h, Component } = preact; -const rspace = /\s\s+/g, - rtrim = /^\s+|\s+$/g; - -function spaced(s: string) { return (" " + s + " ").replace(rspace, " "); } -function trim(s: string) { return s.replace(rtrim, ""); } - -function hasClass(elem: Element, value: string) { - const className = spaced(elem.className || ""); - return className.indexOf( " " + value + " " ) >= 0; -} - -function addClass(elem: Element, value: string) { - const className = spaced(elem.className || ""); - if ( className.indexOf( " " + value + " " ) < 0 ) { - elem.className = trim(className + " " + value); - } -} - -function removeClass(elem: Element, value: string) { - let className = spaced(elem.className || ""); - className = className.replace(" " + value + " ", " "); - elem.className = trim(className); -} - -function toggleClass(elem: Element, valueOn: string, valueOff: string, bool?: boolean): boolean { - if (bool == null) { bool = ! hasClass(elem, valueOn); } - if (bool) { - removeClass(elem, valueOff); - addClass(elem, valueOn); - } - else { - removeClass(elem, valueOn); - addClass(elem, valueOff); - } - return bool; -} - -function makeClassToggle(valueOn: string, valueOff: string): (elem: Element, bool?: boolean) => boolean { - return function(elem, bool) { - return toggleClass(elem, valueOn, valueOff, bool); - } -} - -const toggleShow = makeClassToggle("show", "hide"); +// Get all of the styles that are available function styles(): HTMLLinkElement[] { const es = Array.prototype.slice.call(document.getElementsByTagName("link")); return es.filter((a: HTMLLinkElement) => a.rel.indexOf("style") != -1 && a.title); } -class StyleMenuButton extends Component<any, any> { - - render(props: { stys: string[] }) { - function action() { - styleMenu(); - return false; - }; - - return <li><div id='style-menu-holder' onClick={action}> - <a href='#'>Style ▾</a> - <ul id='style-menu' class='hide'> - {props.stys.map((sty) => { - function action() { - setActiveStyleSheet(sty); - return false; - }; - - return <li><a href='#' onClick={action}>{sty}</a></li>; - })} - </ul> - </div></li>; - } - -} - -function addStyleMenu() { - const stys = styles().map((s) => s.title); - if (stys.length > 1) { - const pageMenu = document.querySelector('#page-menu') as HTMLUListElement; - const dummy = document.createElement('li'); - pageMenu.appendChild(dummy); - preact.render(<StyleMenuButton stys={stys} title="Style"/>, pageMenu, dummy); - } -} - +// Set a style (including setting the cookie) function setActiveStyleSheet(title: string) { const as = styles(); let found: null | HTMLLinkElement = null; @@ -110,17 +33,103 @@ function setActiveStyleSheet(title: string) { } } +// Reset the style based on the cookie function resetStyle() { const s = getCookie("haddock-style"); if (s) setActiveStyleSheet(s); } -function styleMenu(show?: boolean) { - const m = document.getElementById('style-menu'); - if (m) toggleShow(m, show); +class StylesButton extends Component<any, any> { + render(props: { title: string, onClick: () => void }) { + function onClick(e: Event) { + e.preventDefault(); + props.onClick(); + } + return <li><a href="#" onClick={onClick}>{props.title}</a></li>; + } } -export function init() { - addStyleMenu(); +// Add the style menu button +function addStyleMenu(stys: string[], action: () => void) { + if (stys.length > 1) { + const pageMenu = document.querySelector('#page-menu') as HTMLUListElement; + const dummy = document.createElement('li'); + pageMenu.appendChild(dummy); + preact.render(<StylesButton onClick={action} title="Styles"/>, pageMenu, dummy); + } +} + +type StyleProps = { + styles: string[] + showHideTrigger: (action: () => void) => void +} + +type StyleState = { + isVisible: boolean +} + +// Represents the full style dropdown +class Styles extends Component<StyleProps, StyleState> { + + componentWillMount() { + document.addEventListener('mousedown', this.hide.bind(this)); + + document.addEventListener('keydown', (e) => { + if (this.state.isVisible) { + if (e.key === 'Escape') { + this.hide(); + } + } + }) + } + + hide() { + this.setState({ isVisible: false }); + } + + show() { + if (!this.state.isVisible) { + this.setState({ isVisible: true }); + } + } + + toggleVisibility() { + if (this.state.isVisible) { + this.hide(); + } else { + this.show(); + } + } + + componentDidMount() { + this.props.showHideTrigger(this.toggleVisibility.bind(this)); + } + + render(props: StyleProps, state: StyleState) { + const stopPropagation = (e: Event) => { e.stopPropagation(); }; + + return <div id="style" class={state.isVisible ? '' : 'hidden'}> + <div id="style-menu" class="dropdown-menu" onMouseDown={stopPropagation}> + { + props.styles.map((sty) => + <button type="button" + onClick={(e) => { this.hide(); setActiveStyleSheet(sty) }}> + {sty} + </button> + ) + } + </div> + </div>; + } +} + + +export function init(showHide?: (action: () => void) => void) { + const stys = styles().map((s) => s.title); + const addStylesButton = (action: () => void) => addStyleMenu(stys, action) resetStyle(); + preact.render( + <Styles showHideTrigger={showHide || addStylesButton} styles={stys} />, + document.body + ); } diff --git a/haddock-api/resources/html/quick-jump.css b/haddock-api/resources/html/quick-jump.css index 468d8036..8772809c 100644 --- a/haddock-api/resources/html/quick-jump.css +++ b/haddock-api/resources/html/quick-jump.css @@ -1,3 +1,11 @@ +/* @group Fundamentals */ + +.hidden { + display: none; +} + +/* @end */ + /* @group Search box layout */ #search { @@ -11,8 +19,10 @@ overflow-y: auto; } -#search.hidden { - display: none; +@media only screen and (max-width: 999px) { + #search { + top: 5.7em; + } } #search-form, #search-results { @@ -162,3 +172,49 @@ } /* @end */ + +/* @group Dropdown menus */ + +/* Based on #search styling above. */ + +.dropdown-menu { + position: fixed; + /* Not robust to window size changes. */ + top: 3.2em; + right: 0; + /* To display on top of synopsis menu on right side. */ + z-index: 1000; + border: 0.05em solid #b2d5fb; + background: #e8f3ff; +} + +@media only screen and (max-width: 999px) { + .dropdown-menu { + top: 5.7em; + } +} + +.dropdown-menu * { + margin: 0.1em; +} + +.dropdown-menu button { + border: 1px #5E5184 solid; + border-radius: 3px; + background: #5E5184; + padding: 3px; + color: #f4f4f4; + min-width: 6em; +} + +.dropdown-menu button:hover { + color: #5E5184; + background: #f4f4f4; +} + +.dropdown-menu button:active { + color: #f4f4f4; + background: #5E5184; +} + +/* @end */ diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 68392ab3..cf7bd857 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -42,6 +42,7 @@ import Haddock.Utils import Haddock.GhcUtils (modifySessionDynFlags, setOutputDir) import Control.Monad hiding (forM_) +import Data.Bifunctor (second) import Data.Foldable (forM_, foldl') import Data.Traversable (for) import Data.List (isPrefixOf) @@ -73,7 +74,7 @@ import Packages import Panic (handleGhcException) import Module import FastString -import qualified DynamicLoading +import Outputable (defaultUserStyle) -------------------------------------------------------------------------------- -- * Exception handling @@ -183,7 +184,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do forM_ (optShowInterfaceFile flags) $ \path -> liftIO $ do mIfaceFile <- readInterfaceFiles freshNameCache [(("", Nothing), path)] noChecks forM_ mIfaceFile $ \(_, ifaceFile) -> do - putMsg dflags (renderJson (jsonInterfaceFile ifaceFile)) + logOutput dflags (defaultUserStyle dflags) (renderJson (jsonInterfaceFile ifaceFile)) if not (null files) then do (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files @@ -425,7 +426,7 @@ render dflags flags sinceQual qual ifaces installedIfaces extSrcMap = do when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming dflags' "ppHyperlinkedSource" (const ()) $ do _ <- {-# SCC ppHyperlinkedSource #-} - ppHyperlinkedSource odir libDir opt_source_css pretty srcMap ifaces + ppHyperlinkedSource (verbosity flags) odir libDir opt_source_css pretty srcMap ifaces return () @@ -472,10 +473,7 @@ withGhc' libDir needHieFiles flags ghcActs = runGhc (Just libDir) $ do -- that may need to be re-linked: Haddock doesn't do any -- dynamic or static linking at all! _ <- setSessionDynFlags dynflags'' - hscenv <- GHC.getSession - dynflags''' <- liftIO (DynamicLoading.initializePlugins hscenv dynflags'') - _ <- setSessionDynFlags dynflags''' - ghcActs dynflags''' + ghcActs dynflags'' where -- ignore sublists of flags that start with "+RTS" and end in "-RTS" @@ -691,7 +689,7 @@ getPrologue dflags flags = h <- openFile filename ReadMode hSetEncoding h utf8 str <- hGetContents h -- semi-closes the handle - return . Just $! parseParas dflags Nothing str + return . Just $! second (fmap rdrName) $ parseParas dflags Nothing str _ -> throwE "multiple -p/--prologue options" diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index b76d14b5..1f98ef9c 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -254,13 +254,14 @@ ppCtor dflags dat subdocs con@ConDeclH98 {} -- docs for con_names on why it is a list to begin with. name = commaSeparate dflags . map unL $ getConNames con - tyVarArg (UserTyVar _ n) = HsTyVar noExtField NotPromoted n - tyVarArg (KindedTyVar _ n lty) = HsKindSig noExtField (reL (HsTyVar noExtField NotPromoted n)) lty - tyVarArg _ = panic "ppCtor" + resType = let c = HsTyVar noExtField NotPromoted (reL (tcdName dat)) + as = map (tyVarBndr2Type . unLoc) (hsQTvExplicit $ tyClDeclTyVars dat) + in apps (map reL (c : as)) - resType = apps $ map reL $ - (HsTyVar noExtField NotPromoted (reL (tcdName dat))) : - map (tyVarArg . unLoc) (hsQTvExplicit $ tyClDeclTyVars dat) + tyVarBndr2Type :: HsTyVarBndr GhcRn -> HsType GhcRn + tyVarBndr2Type (UserTyVar _ n) = HsTyVar noExtField NotPromoted n + tyVarBndr2Type (KindedTyVar _ n k) = HsKindSig noExtField (reL (HsTyVar noExtField NotPromoted n)) k + tyVarBndr2Type (XTyVarBndr _) = panic "haddock:ppCtor" ppCtor dflags _dat subdocs con@(ConDeclGADT { }) = concatMap (lookupCon dflags subdocs) (getConNames con) ++ f @@ -325,7 +326,7 @@ markupTag dflags = Markup { markupString = str, markupAppend = (++), markupIdentifier = box (TagInline "a") . str . out dflags, - markupIdentifierUnchecked = box (TagInline "a") . str . out dflags . snd, + markupIdentifierUnchecked = box (TagInline "a") . str . showWrapped (out dflags . snd), markupModule = box (TagInline "a") . str, markupWarning = box (TagInline "i"), markupEmphasis = box (TagInline "i"), diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index 7571db9e..3f5483fe 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -7,7 +7,7 @@ module Haddock.Backends.Hyperlinker import Haddock.Types -import Haddock.Utils (writeUtf8File) +import Haddock.Utils (writeUtf8File, out, verbose, Verbosity) import Haddock.Backends.Hyperlinker.Renderer import Haddock.Backends.Hyperlinker.Parser import Haddock.Backends.Hyperlinker.Types @@ -18,12 +18,13 @@ import Data.Maybe import System.Directory import System.FilePath -import HieTypes ( HieFile(..), HieASTs(..) ) +import HieTypes ( HieFile(..), HieAST(..), HieASTs(..), NodeInfo(..) ) import HieBin ( readHieFile, hie_file_result) import Data.Map as M import FastString ( mkFastString ) import Module ( Module, moduleName ) import NameCache ( initNameCache ) +import SrcLoc ( mkRealSrcLoc, realSrcLocSpan ) import UniqSupply ( mkSplitUniqSupply ) @@ -32,27 +33,28 @@ import UniqSupply ( mkSplitUniqSupply ) -- Note that list of interfaces should also contain interfaces normally hidden -- when generating documentation. Otherwise this could lead to dead links in -- produced source. -ppHyperlinkedSource :: FilePath -- ^ Output directory +ppHyperlinkedSource :: Verbosity + -> FilePath -- ^ Output directory -> FilePath -- ^ Resource directory -> Maybe FilePath -- ^ Custom CSS file path -> Bool -- ^ Flag indicating whether to pretty-print HTML -> M.Map Module SrcPath -- ^ Paths to sources -> [Interface] -- ^ Interfaces for which we create source -> IO () -ppHyperlinkedSource outdir libdir mstyle pretty srcs' ifaces = do +ppHyperlinkedSource verbosity outdir libdir mstyle pretty srcs' ifaces = do createDirectoryIfMissing True srcdir let cssFile = fromMaybe (defaultCssFile libdir) mstyle copyFile cssFile $ srcdir </> srcCssFile copyFile (libdir </> "html" </> highlightScript) $ srcdir </> highlightScript - mapM_ (ppHyperlinkedModuleSource srcdir pretty srcs) ifaces + mapM_ (ppHyperlinkedModuleSource verbosity srcdir pretty srcs) ifaces where srcdir = outdir </> hypSrcDir srcs = (srcs', M.mapKeys moduleName srcs') -- | Generate hyperlinked source for particular interface. -ppHyperlinkedModuleSource :: FilePath -> Bool -> SrcMaps -> Interface -> IO () -ppHyperlinkedModuleSource srcdir pretty srcs iface = case ifaceHieFile iface of +ppHyperlinkedModuleSource :: Verbosity -> FilePath -> Bool -> SrcMaps -> Interface -> IO () +ppHyperlinkedModuleSource verbosity srcdir pretty srcs iface = case ifaceHieFile iface of Just hfp -> do -- Parse the GHC-produced HIE file u <- mkSplitUniqSupply 'a' @@ -64,25 +66,38 @@ ppHyperlinkedModuleSource srcdir pretty srcs iface = case ifaceHieFile iface of <$> (readHieFile (initNameCache u []) hfp) -- Get the AST and tokens corresponding to the source file we want - let mast | M.size asts == 1 = snd <$> M.lookupMin asts - | otherwise = M.lookup (mkFastString file) asts + let fileFs = mkFastString file + mast | M.size asts == 1 = snd <$> M.lookupMin asts + | otherwise = M.lookup fileFs asts + ast = fromMaybe (emptyHieAst fileFs) mast + fullAst = recoverFullIfaceTypes df types ast tokens = parse df file rawSrc + -- Warn if we didn't find an AST, but there were still ASTs + if M.null asts + then pure () + else out verbosity verbose $ unwords [ "couldn't find ast for" + , file, show (M.keys asts) ] + -- Produce and write out the hyperlinked sources - case mast of - Just ast -> - let fullAst = recoverFullIfaceTypes df types ast - in writeUtf8File path . renderToString pretty . render' fullAst $ tokens - Nothing - | M.size asts == 0 -> return () - | otherwise -> error $ unwords [ "couldn't find ast for" - , file, show (M.keys asts) ] + writeUtf8File path . renderToString pretty . render' fullAst $ tokens Nothing -> return () where df = ifaceDynFlags iface render' = render (Just srcCssFile) (Just highlightScript) srcs path = srcdir </> hypSrcModuleFile (ifaceMod iface) + emptyNodeInfo = NodeInfo + { nodeAnnotations = mempty + , nodeType = [] + , nodeIdentifiers = mempty + } + emptyHieAst fileFs = Node + { nodeInfo = emptyNodeInfo + , nodeSpan = realSrcLocSpan (mkRealSrcLoc fileFs 1 0) + , nodeChildren = [] + } + -- | Name of CSS file in output directory. srcCssFile :: FilePath srcCssFile = "style.css" diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index e9029ae6..0247d567 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -9,7 +9,7 @@ import qualified Data.ByteString as BS import BasicTypes ( IntegralLit(..) ) import DynFlags -import ErrUtils ( emptyMessages, pprLocErrMsg ) +import ErrUtils ( pprLocErrMsg ) import FastString ( mkFastString ) import Lexer ( P(..), ParseResult(..), PState(..), Token(..) , mkPStatePure, lexer, mkParserFlags', getErrorMessages, addFatalError ) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs index 67eb10b5..612f3f08 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs @@ -102,7 +102,7 @@ type PrintedType = String -- > hieAst -- -- However, this is very inefficient (both in time and space) because the --- mutliple calls to 'recoverFullType' don't share intermediate results. This +-- multiple calls to 'recoverFullType' don't share intermediate results. This -- function fixes that. recoverFullIfaceTypes :: DynFlags diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 6fd7969f..f2fb1041 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -103,6 +103,10 @@ haddockSty = "haddock.sty" type LaTeX = Pretty.Doc +-- | Default way of rendering a 'LaTeX'. The width is 90 by default (since 100 +-- often overflows the line). +latex2String :: LaTeX -> String +latex2String = fullRender PageMode 90 1 txtPrinter "" ppLaTeXTop :: String @@ -156,7 +160,7 @@ ppLaTeXModule _title odir iface = do text "\\haddockbeginheader", verb $ vcat [ text "module" <+> text mdl_str <+> lparen, - text " " <> fsep (punctuate (text ", ") $ + text " " <> fsep (punctuate (char ',') $ map exportListItem $ filter forSummary exports), text " ) where" @@ -171,7 +175,7 @@ ppLaTeXModule _title odir iface = do body = processExports exports -- - writeUtf8File (odir </> moduleLaTeXFile mdl) (fullRender PageMode 80 1 txtPrinter "" tex) + writeUtf8File (odir </> moduleLaTeXFile mdl) (show tex) -- | Prints out an entry in a module export list. exportListItem :: ExportItem DocNameI -> LaTeX @@ -287,7 +291,7 @@ ppDecl :: LHsDecl DocNameI -- ^ decl to print -> LaTeX ppDecl decl pats (doc, fnArgsDoc) instances subdocs _fxts = case unLoc decl of - TyClD _ d@FamDecl {} -> ppFamDecl doc instances d unicode + TyClD _ d@FamDecl {} -> ppFamDecl False doc instances d unicode TyClD _ d@DataDecl {} -> ppDataDecl pats instances subdocs (Just doc) d unicode TyClD _ d@SynDecl {} -> ppTySyn (doc, fnArgsDoc) d unicode -- Family instances happen via FamInst now @@ -295,7 +299,7 @@ ppDecl decl pats (doc, fnArgsDoc) instances subdocs _fxts = case unLoc decl of -- | Just _ <- tcdTyPats d -> ppTyInst False loc doc d unicode -- Family instances happen via FamInst now TyClD _ d@ClassDecl{} -> ppClassDecl instances doc subdocs d unicode - SigD _ (TypeSig _ lnames ty) -> ppFunSig (doc, fnArgsDoc) (map unLoc lnames) (hsSigWcType ty) unicode + SigD _ (TypeSig _ lnames ty) -> ppFunSig Nothing (doc, fnArgsDoc) (map unLoc lnames) (hsSigWcType ty) unicode SigD _ (PatSynSig _ lnames ty) -> ppLPatSig (doc, fnArgsDoc) (map unLoc lnames) ty unicode ForD _ d -> ppFor (doc, fnArgsDoc) d unicode InstD _ _ -> empty @@ -307,7 +311,7 @@ ppDecl decl pats (doc, fnArgsDoc) instances subdocs _fxts = case unLoc decl of ppFor :: DocForDecl DocName -> ForeignDecl DocNameI -> Bool -> LaTeX ppFor doc (ForeignImport _ (L _ name) typ _) unicode = - ppFunSig doc [name] (hsSigTypeI typ) unicode + ppFunSig Nothing doc [name] (hsSigTypeI typ) unicode ppFor _ _ _ = error "ppFor error in Haddock.Backends.LaTeX" -- error "foreign declarations are currently not supported by --latex" @@ -317,13 +321,14 @@ ppFor _ _ _ = error "ppFor error in Haddock.Backends.LaTeX" ------------------------------------------------------------------------------- -- | Pretty-print a data\/type family declaration -ppFamDecl :: Documentation DocName -- ^ this decl's docs +ppFamDecl :: Bool -- ^ is the family associated? + -> Documentation DocName -- ^ this decl's docs -> [DocInstance DocNameI] -- ^ relevant instances -> TyClDecl DocNameI -- ^ family to print -> Bool -- ^ unicode -> LaTeX -ppFamDecl doc instances decl unicode = - declWithDoc (ppFamHeader (tcdFam decl) unicode <+> whereBit) +ppFamDecl associated doc instances decl unicode = + declWithDoc (ppFamHeader (tcdFam decl) unicode associated <+> whereBit) (if null body then Nothing else Just (vcat body)) $$ instancesBit where @@ -335,6 +340,7 @@ ppFamDecl doc instances decl unicode = familyEqns | FamilyDecl { fdInfo = ClosedTypeFamily (Just eqns) } <- tcdFam decl + , not (null eqns) = Just (text "\\haddockbeginargs" $$ vcat [ decltt (ppFamDeclEqn eqn) <+> nl | L _ eqn <- eqns ] $$ text "\\end{tabulary}\\par") @@ -356,22 +362,26 @@ ppFamDecl doc instances decl unicode = -- | Print the LHS of a type\/data family declaration. ppFamHeader :: FamilyDecl DocNameI -- ^ family header to print - -> Bool -- ^ unicode - -> LaTeX -ppFamHeader (XFamilyDecl nec) _ = noExtCon nec + -> Bool -- ^ unicode + -> Bool -- ^ is the family associated? + -> LaTeX +ppFamHeader (XFamilyDecl nec) _ _ = noExtCon nec ppFamHeader (FamilyDecl { fdLName = L _ name , fdTyVars = tvs , fdInfo = info , fdResultSig = L _ result , fdInjectivityAnn = injectivity }) - unicode = - leader <+> keyword "family" <+> famName <+> famSig <+> injAnn + unicode associated = + famly leader <+> famName <+> famSig <+> injAnn where leader = case info of OpenTypeFamily -> keyword "type" ClosedTypeFamily _ -> keyword "type" DataFamily -> keyword "data" + famly | associated = id + | otherwise = (<+> keyword "family") + famName = ppAppDocNameTyVarBndrs unicode name (hsq_explicit tvs) famSig = case result of @@ -414,17 +424,23 @@ ppTySyn _ _ _ = error "declaration not supported by ppTySyn" ------------------------------------------------------------------------------- -ppFunSig :: DocForDecl DocName -> [DocName] -> LHsType DocNameI - -> Bool -> LaTeX -ppFunSig doc docnames (L _ typ) unicode = +ppFunSig + :: Maybe LaTeX -- ^ a prefix to put right before the signature + -> DocForDecl DocName -- ^ documentation + -> [DocName] -- ^ pattern names in the pattern signature + -> LHsType DocNameI -- ^ type of the pattern synonym + -> Bool -- ^ unicode + -> LaTeX +ppFunSig leader doc docnames (L _ typ) unicode = ppTypeOrFunSig typ doc - ( ppTypeSig names typ False - , hsep . punctuate comma $ map ppSymName names + ( lead $ ppTypeSig names typ False + , lead $ hsep . punctuate comma $ map ppSymName names , dcolon unicode ) unicode where names = map getName docnames + lead = maybe id (<+>) leader -- | Pretty-print a pattern synonym ppLPatSig :: DocForDecl DocName -- ^ documentation @@ -433,15 +449,7 @@ ppLPatSig :: DocForDecl DocName -- ^ documentation -> Bool -- ^ unicode -> LaTeX ppLPatSig doc docnames ty unicode - = ppTypeOrFunSig typ doc - ( keyword "pattern" <+> ppTypeSig names typ False - , keyword "pattern" <+> (hsep . punctuate comma $ map ppSymName names) - , dcolon unicode - ) - unicode - where - typ = unLoc (hsSigTypeI ty) - names = map getName docnames + = ppFunSig (Just (keyword "pattern")) doc docnames (hsSigTypeI ty) unicode -- | Pretty-print a type, adding documentation to the whole type and its -- arguments as needed. @@ -461,7 +469,7 @@ ppTypeOrFunSig typ (doc, argDocs) (pref1, pref2, sep0) unicode text "\\end{tabulary}\\par" $$ fromMaybe empty (documentationToLaTeX doc) --- This splits up a type signature along `->` and adds docs (when they exist) +-- | This splits up a type signature along @->@ and adds docs (when they exist) -- to the arguments. The output is a list of (leader/seperator, argument and -- its doc) ppSubSigLike :: Bool -- ^ unicode @@ -479,13 +487,13 @@ ppSubSigLike unicode typ argDocs subdocs leader = do_args 0 leader typ do_args :: Int -> LaTeX -> HsType DocNameI -> [(LaTeX, LaTeX)] do_args _n leader (HsForAllTy _ fvf tvs ltype) = [ ( decltt leader - , decltt (hsep (forallSymbol unicode : ppTyVars tvs ++ - [ppForAllSeparator unicode fvf])) + , decltt (ppForAllPart unicode tvs fvf) <+> ppLType unicode ltype ) ] do_args n leader (HsQualTy _ lctxt ltype) - = (decltt leader, ppLContextNoArrow lctxt unicode <+> nl) - : do_largs n (darrow unicode) ltype + = ( decltt leader + , decltt (ppLContextNoArrow lctxt unicode) <+> nl + ) : do_largs n (darrow unicode) ltype do_args n leader (HsFunTy _ (L _ (HsRecTy _ fields)) r) = [ (decltt ldr, latex <+> nl) @@ -504,9 +512,9 @@ ppSubSigLike unicode typ argDocs subdocs leader = do_args 0 leader typ -- We need 'gadtComma' and 'gadtEnd' to line up with the `{` from -- 'gadtOpen', so we add 3 spaces to cover for `-> `/`:: ` (3 in unicode -- mode since `->` and `::` are rendered as single characters. - gadtComma = hcat (replicate (if unicode then 3 else 4) (text "\\ ")) <> text "," - gadtEnd = hcat (replicate (if unicode then 3 else 4) (text "\\ ")) <> text "\\}" - gadtOpen = text "\\{" + gadtComma = hcat (replicate (if unicode then 3 else 4) (char ' ')) <> char ',' + gadtEnd = hcat (replicate (if unicode then 3 else 4) (char ' ')) <> char '}' + gadtOpen = char '{' ppForAllSeparator :: Bool -> ForallVisFlag -> LaTeX @@ -522,8 +530,9 @@ ppTypeSig nms ty unicode = <+> ppType unicode ty -ppTyVars :: [LHsTyVarBndr DocNameI] -> [LaTeX] -ppTyVars = map (ppSymName . getName . hsLTyVarNameI) +-- | Pretty-print type variables. +ppTyVars :: Bool -> [LHsTyVarBndr DocNameI] -> [LaTeX] +ppTyVars unicode = map (ppHsTyVarBndr unicode . unLoc) tyvarNames :: LHsQTyVars DocNameI -> [Name] @@ -534,10 +543,9 @@ declWithDoc :: LaTeX -> Maybe LaTeX -> LaTeX declWithDoc decl doc = text "\\begin{haddockdesc}" $$ text "\\item[\\begin{tabular}{@{}l}" $$ - text (latexMonoFilter (show decl)) $$ - text "\\end{tabular}]" <> - (if isNothing doc then empty else text "\\haddockbegindoc") $$ - maybe empty id doc $$ + text (latexMonoFilter (latex2String decl)) $$ + text "\\end{tabular}]" $$ + maybe empty (\x -> text "{\\haddockbegindoc" $$ x <> text "}") doc $$ text "\\end{haddockdesc}" @@ -548,9 +556,9 @@ multiDecl :: [LaTeX] -> LaTeX multiDecl decls = text "\\begin{haddockdesc}" $$ vcat [ - text "\\item[" $$ - text (latexMonoFilter (show decl)) $$ - text "]" + text "\\item[\\begin{tabular}{@{}l}" $$ + text (latexMonoFilter (latex2String decl)) $$ + text "\\end{tabular}]" | decl <- decls ] $$ text "\\end{haddockdesc}" @@ -594,6 +602,7 @@ ppFds fds unicode = hsep (map (ppDocName . unLoc) vars2) +-- TODO: associated type defaults, docs on default methods ppClassDecl :: [DocInstance DocNameI] -> Documentation DocName -> [(DocName, DocForDecl DocName)] -> TyClDecl DocNameI -> Bool -> LaTeX @@ -614,18 +623,28 @@ ppClassDecl instances doc subdocs body_ | null lsigs, null ats, null at_defs = Nothing | null ats, null at_defs = Just methodTable ---- | otherwise = atTable $$ methodTable - | otherwise = error "LaTeX.ppClassDecl" + | otherwise = Just (atTable $$ methodTable) + + atTable = + text "\\haddockpremethods{}" <> emph (text "Associated Types") $$ + vcat [ ppFamDecl True (fst doc) [] (FamDecl noExtField decl) True + | L _ decl <- ats + , let name = unL . fdLName $ decl + doc = lookupAnySubdoc name subdocs + ] + methodTable = text "\\haddockpremethods{}" <> emph (text "Methods") $$ - vcat [ ppFunSig doc names (hsSigWcType typ) unicode - | L _ (TypeSig _ lnames typ) <- lsigs - , let doc = lookupAnySubdoc (head names) subdocs - names = map unLoc lnames ] - -- FIXME: is taking just the first name ok? Is it possible that - -- there are different subdocs for different names in a single - -- type signature? + vcat [ ppFunSig leader doc names (hsSigTypeI typ) unicode + | L _ (ClassOpSig _ is_def lnames typ) <- lsigs + , let doc | is_def = noDocForDecl + | otherwise = lookupAnySubdoc (head names) subdocs + names = map unLoc lnames + leader = if is_def then Just (keyword "default") else Nothing + ] + -- N.B. taking just the first name is ok. Signatures with multiple + -- names are expanded so that each name gets its own signature. instancesBit = ppDocInstances unicode instances @@ -644,6 +663,7 @@ ppDocInstances unicode (i : rest) isUndocdInstance :: DocInstance a -> Maybe (InstHead a) isUndocdInstance (i,Nothing,_,_) = Just i +isUndocdInstance (i,Just (MetaDoc _ DocEmpty),_,_) = Just i isUndocdInstance _ = Nothing -- | Print a possibly commented instance. The instance header is printed inside @@ -726,15 +746,21 @@ ppDataDecl pats instances subdocs doc dataDecl unicode = -- ppConstrHdr is for (non-GADT) existentials constructors' syntax -ppConstrHdr :: Bool -> [Name] -> HsContext DocNameI -> Bool -> LaTeX -ppConstrHdr forall tvs ctxt unicode - = (if null tvs then empty else ppForall) - <+> - (if null ctxt then empty else ppContextNoArrow ctxt unicode <+> darrow unicode <+> text " ") +ppConstrHdr + :: Bool -- ^ print explicit foralls + -> [LHsTyVarBndr DocNameI] -- ^ type variables + -> HsContext DocNameI -- ^ context + -> Bool -- ^ unicode + -> LaTeX +ppConstrHdr forall_ tvs ctxt unicode = ppForall <> ppCtxt where - ppForall = case forall of - True -> forallSymbol unicode <+> hsep (map ppName tvs) <+> text ". " - False -> empty + ppForall + | null tvs || not forall_ = empty + | otherwise = ppForAllPart unicode tvs ForallInvis + + ppCtxt + | null ctxt = empty + | otherwise = ppContextNoArrow ctxt unicode <+> darrow unicode <> space -- | Pretty-print a constructor @@ -763,11 +789,10 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = -- First line of the constructor (no doc, no fields, single-line) decl = case con of ConDeclH98{ con_args = det - , con_ex_tvs = vars + , con_ex_tvs = tyVars + , con_forall = L _ forall_ , con_mb_cxt = cxt - } -> let tyVars = map (getName . hsLTyVarNameI) vars - context = unLoc (fromMaybe (noLoc []) cxt) - forall_ = False + } -> let context = unLoc (fromMaybe (noLoc []) cxt) header_ = ppConstrHdr forall_ tyVars context unicode in case det of -- Prefix constructor, e.g. 'Just a' @@ -1004,7 +1029,7 @@ ppLFunLhType unicode y = ppFunLhType unicode (unLoc y) ppType, ppParendType, ppFunLhType, ppCtxType :: Bool -> HsType DocNameI -> LaTeX ppType unicode ty = ppr_mono_ty (reparenTypePrec PREC_TOP ty) unicode -ppParendType unicode ty = ppr_mono_ty (reparenTypePrec PREC_TOP ty) unicode +ppParendType unicode ty = ppr_mono_ty (reparenTypePrec PREC_CON ty) unicode ppFunLhType unicode ty = ppr_mono_ty (reparenTypePrec PREC_FUN ty) unicode ppCtxType unicode ty = ppr_mono_ty (reparenTypePrec PREC_CTX ty) unicode @@ -1017,7 +1042,7 @@ ppLHsTypeArg _ (HsArgPar _) = text "" ppHsTyVarBndr :: Bool -> HsTyVarBndr DocNameI -> LaTeX ppHsTyVarBndr _ (UserTyVar _ (L _ name)) = ppDocName name ppHsTyVarBndr unicode (KindedTyVar _ (L _ name) kind) = - parens (ppDocName name) <+> dcolon unicode <+> ppLKind unicode kind + parens (ppDocName name <+> dcolon unicode <+> ppLKind unicode kind) ppHsTyVarBndr _ (XTyVarBndr nec) = noExtCon nec ppLKind :: Bool -> LHsKind DocNameI -> LaTeX @@ -1030,14 +1055,22 @@ ppKind unicode ki = ppr_mono_ty (reparenTypePrec PREC_TOP ki) unicode -- Drop top-level for-all type variables in user style -- since they are implicit in Haskell +ppForAllPart :: Bool -> [LHsTyVarBndr DocNameI] -> ForallVisFlag -> LaTeX +ppForAllPart unicode tvs fvf = hsep (forallSymbol unicode : tvs') <> fv + where + tvs' = ppTyVars unicode tvs + fv = case fvf of + ForallVis -> text "\\ " <> arrow unicode + ForallInvis -> dot + + ppr_mono_lty :: LHsType DocNameI -> Bool -> LaTeX ppr_mono_lty ty unicode = ppr_mono_ty (unLoc ty) unicode ppr_mono_ty :: HsType DocNameI -> Bool -> LaTeX ppr_mono_ty (HsForAllTy _ fvf tvs ty) unicode - = sep [ hsep (forallSymbol unicode : ppTyVars tvs) <> - ppForAllSeparator unicode fvf + = sep [ ppForAllPart unicode tvs fvf , ppr_mono_lty ty unicode ] ppr_mono_ty (HsQualTy _ ctxt ty) unicode = sep [ ppLContext ctxt unicode @@ -1051,7 +1084,7 @@ ppr_mono_ty (HsTyVar _ NotPromoted (L _ name)) _ = ppDocName name ppr_mono_ty (HsTyVar _ IsPromoted (L _ name)) _ = char '\'' <> ppDocName name ppr_mono_ty (HsTupleTy _ con tys) u = tupleParens con (map (ppLType u) tys) ppr_mono_ty (HsSumTy _ tys) u = sumParens (map (ppLType u) tys) -ppr_mono_ty (HsKindSig _ ty kind) u = parens (ppr_mono_lty ty u <+> dcolon u <+> ppLKind u kind) +ppr_mono_ty (HsKindSig _ ty kind) u = ppr_mono_lty ty u <+> dcolon u <+> ppLKind u kind ppr_mono_ty (HsListTy _ ty) u = brackets (ppr_mono_lty ty u) ppr_mono_ty (HsIParamTy _ (L _ n) ty) u = ppIPName n <+> dcolon u <+> ppr_mono_lty ty u ppr_mono_ty (HsSpliceTy {}) _ = error "ppr_mono_ty HsSpliceTy" @@ -1080,7 +1113,7 @@ ppr_mono_ty (HsParTy _ ty) unicode ppr_mono_ty (HsDocTy _ ty _) unicode = ppr_mono_lty ty unicode -ppr_mono_ty (HsWildCardTy _) _ = text "\\_" +ppr_mono_ty (HsWildCardTy _) _ = char '_' ppr_mono_ty (HsTyLit _ t) u = ppr_tylit t u ppr_mono_ty (HsStarTy _ isUni) unicode = starSymbol (isUni || unicode) @@ -1114,9 +1147,6 @@ ppSymName name | otherwise = ppName name -ppVerbOccName :: OccName -> LaTeX -ppVerbOccName = text . latexFilter . occNameString - ppIPName :: HsIPName -> LaTeX ppIPName = text . ('?':) . unpackFS . hsIPNameFS @@ -1124,18 +1154,9 @@ ppOccName :: OccName -> LaTeX ppOccName = text . occNameString -ppVerbDocName :: DocName -> LaTeX -ppVerbDocName = ppVerbOccName . nameOccName . getName - - -ppVerbRdrName :: RdrName -> LaTeX -ppVerbRdrName = ppVerbOccName . rdrNameOcc - - ppDocName :: DocName -> LaTeX ppDocName = ppOccName . nameOccName . getName - ppLDocName :: Located DocName -> LaTeX ppLDocName (L _ d) = ppDocName d @@ -1173,9 +1194,10 @@ latexMunge c s = c : s latexMonoMunge :: Char -> String -> String -latexMonoMunge ' ' s = '\\' : ' ' : s +latexMonoMunge ' ' (' ':s) = "\\ \\ " ++ s +latexMonoMunge ' ' ('\\':' ':s) = "\\ \\ " ++ s latexMonoMunge '\n' s = '\\' : '\\' : s -latexMonoMunge c s = latexMunge c s +latexMonoMunge c s = latexMunge c s ------------------------------------------------------------------------------- @@ -1183,34 +1205,40 @@ latexMonoMunge c s = latexMunge c s ------------------------------------------------------------------------------- -parLatexMarkup :: (a -> LaTeX) -> DocMarkup a (StringContext -> LaTeX) -parLatexMarkup ppId = Markup { - markupParagraph = \p v -> p v <> text "\\par" $$ text "", - markupEmpty = \_ -> empty, - markupString = \s v -> text (fixString v s), - markupAppend = \l r v -> l v <> r v, - markupIdentifier = markupId ppId, - markupIdentifierUnchecked = markupId (ppVerbOccName . snd), - markupModule = \m _ -> let (mdl,_ref) = break (=='#') m in tt (text mdl), - markupWarning = \p v -> emph (p v), - markupEmphasis = \p v -> emph (p v), - markupBold = \p v -> bold (p v), - markupMonospaced = \p _ -> tt (p Mono), - markupUnorderedList = \p v -> itemizedList (map ($v) p) $$ text "", - markupPic = \p _ -> markupPic p, - markupMathInline = \p _ -> markupMathInline p, - markupMathDisplay = \p _ -> markupMathDisplay p, - markupOrderedList = \p v -> enumeratedList (map ($v) p) $$ text "", - markupDefList = \l v -> descriptionList (map (\(a,b) -> (a v, b v)) l), - markupCodeBlock = \p _ -> quote (verb (p Verb)) $$ text "", - markupHyperlink = \(Hyperlink u l) p -> markupLink u (fmap ($p) l), - markupAName = \_ _ -> empty, - markupProperty = \p _ -> quote $ verb $ text p, - markupExample = \e _ -> quote $ verb $ text $ unlines $ map exampleToString e, - markupHeader = \(Header l h) p -> header l (h p), - markupTable = \(Table h b) p -> table h b p +latexMarkup :: HasOccName a => DocMarkup (Wrap a) (StringContext -> LaTeX -> LaTeX) +latexMarkup = Markup + { markupParagraph = \p v -> blockElem (p v (text "\\par")) + , markupEmpty = \_ -> id + , markupString = \s v -> inlineElem (text (fixString v s)) + , markupAppend = \l r v -> l v . r v + , markupIdentifier = \i v -> inlineElem (markupId v (fmap occName i)) + , markupIdentifierUnchecked = \i v -> inlineElem (markupId v (fmap snd i)) + , markupModule = \m _ -> inlineElem (let (mdl,_ref) = break (=='#') m in (tt (text mdl))) + , markupWarning = \p v -> p v + , markupEmphasis = \p v -> inlineElem (emph (p v empty)) + , markupBold = \p v -> inlineElem (bold (p v empty)) + , markupMonospaced = \p v -> inlineElem (markupMonospace p v) + , markupUnorderedList = \p v -> blockElem (itemizedList (map (\p' -> p' v empty) p)) + , markupPic = \p _ -> inlineElem (markupPic p) + , markupMathInline = \p _ -> inlineElem (markupMathInline p) + , markupMathDisplay = \p _ -> blockElem (markupMathDisplay p) + , markupOrderedList = \p v -> blockElem (enumeratedList (map (\p' -> p' v empty) p)) + , markupDefList = \l v -> blockElem (descriptionList (map (\(a,b) -> (a v empty, b v empty)) l)) + , markupCodeBlock = \p _ -> blockElem (quote (verb (p Verb empty))) + , markupHyperlink = \(Hyperlink u l) v -> inlineElem (markupLink u (fmap (\x -> x v empty) l)) + , markupAName = \_ _ -> id -- TODO + , markupProperty = \p _ -> blockElem (quote (verb (text p))) + , markupExample = \e _ -> blockElem (quote (verb (text $ unlines $ map exampleToString e))) + , markupHeader = \(Header l h) p -> blockElem (header l (h p empty)) + , markupTable = \(Table h b) p -> blockElem (table h b p) } where + blockElem :: LaTeX -> LaTeX -> LaTeX + blockElem = ($$) + + inlineElem :: LaTeX -> LaTeX -> LaTeX + inlineElem = (<>) + header 1 d = text "\\section*" <> braces d header 2 d = text "\\subsection*" <> braces d header l d @@ -1223,6 +1251,9 @@ parLatexMarkup ppId = Markup { fixString Verb s = s fixString Mono s = latexMonoFilter s + markupMonospace p Verb = p Verb empty + markupMonospace p _ = tt (p Mono empty) + markupLink url mLabel = case mLabel of Just label -> text "\\href" <> braces (text url) <> braces label Nothing -> text "\\url" <> braces (text url) @@ -1239,35 +1270,28 @@ parLatexMarkup ppId = Markup { markupMathDisplay mathjax = text "\\[" <> text mathjax <> text "\\]" - markupId ppId_ id v = + markupId v wrappedOcc = case v of - Verb -> theid - Mono -> theid - Plain -> text "\\haddockid" <> braces theid - where theid = ppId_ id - - -latexMarkup :: DocMarkup DocName (StringContext -> LaTeX) -latexMarkup = parLatexMarkup ppVerbDocName - - -rdrLatexMarkup :: DocMarkup RdrName (StringContext -> LaTeX) -rdrLatexMarkup = parLatexMarkup ppVerbRdrName - + Verb -> text i + Mono -> text "\\haddockid" <> braces (text . latexMonoFilter $ i) + Plain -> text "\\haddockid" <> braces (text . latexFilter $ i) + where i = showWrapped occNameString wrappedOcc docToLaTeX :: Doc DocName -> LaTeX -docToLaTeX doc = markup latexMarkup doc Plain - +docToLaTeX doc = markup latexMarkup doc Plain empty documentationToLaTeX :: Documentation DocName -> Maybe LaTeX documentationToLaTeX = fmap docToLaTeX . fmap _doc . combineDocumentation rdrDocToLaTeX :: Doc RdrName -> LaTeX -rdrDocToLaTeX doc = markup rdrLatexMarkup doc Plain +rdrDocToLaTeX doc = markup latexMarkup doc Plain empty -data StringContext = Plain | Verb | Mono +data StringContext + = Plain -- ^ all special characters have to be escape + | Mono -- ^ on top of special characters, escape space chraacters + | Verb -- ^ don't escape anything latexStripTrailingWhitespace :: Doc a -> Doc a @@ -1292,23 +1316,23 @@ latexStripTrailingWhitespace other = other itemizedList :: [LaTeX] -> LaTeX itemizedList items = - text "\\begin{itemize}" $$ + text "\\vbox{\\begin{itemize}" $$ vcat (map (text "\\item" $$) items) $$ - text "\\end{itemize}" + text "\\end{itemize}}" enumeratedList :: [LaTeX] -> LaTeX enumeratedList items = - text "\\begin{enumerate}" $$ + text "\\vbox{\\begin{enumerate}" $$ vcat (map (text "\\item " $$) items) $$ - text "\\end{enumerate}" + text "\\end{enumerate}}" descriptionList :: [(LaTeX,LaTeX)] -> LaTeX descriptionList items = - text "\\begin{description}" $$ - vcat (map (\(a,b) -> text "\\item" <> brackets a <+> b) items) $$ - text "\\end{description}" + text "\\vbox{\\begin{description}" $$ + vcat (map (\(a,b) -> text "\\item" <> brackets a <> text "\\hfill \\par" $$ b) items) $$ + text "\\end{description}}" tt :: LaTeX -> LaTeX @@ -1316,8 +1340,8 @@ tt ltx = text "\\haddocktt" <> braces ltx decltt :: LaTeX -> LaTeX -decltt ltx = text "\\haddockdecltt" <> braces ltx - +decltt ltx = text "\\haddockdecltt" <> braces (text filtered) + where filtered = latexMonoFilter (latex2String ltx) emph :: LaTeX -> LaTeX emph ltx = text "\\emph" <> braces ltx @@ -1325,6 +1349,12 @@ emph ltx = text "\\emph" <> braces ltx bold :: LaTeX -> LaTeX bold ltx = text "\\textbf" <> braces ltx +-- TODO: @verbatim@ is too much since +-- +-- * Haddock supports markup _inside_ of codeblocks. Right now, the LaTeX +-- representing that markup gets printed verbatim +-- * Verbatim environments are not supported everywhere (example: not nested +-- inside a @tabulary@ environment) verb :: LaTeX -> LaTeX verb doc = text "{\\haddockverb\\begin{verbatim}" $$ doc <> text "\\end{verbatim}}" -- NB. swallow a trailing \n in the verbatim text by appending the diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index a24715a7..c7ae15ca 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -36,11 +36,11 @@ import Text.XHtml hiding ( name, title, p, quote ) import BasicTypes (PromotionFlag(..), isPromoted) import GHC hiding (LexicalFixity(..)) +import qualified GHC import GHC.Exts import Name import BooleanFormula import RdrName ( rdrNameOcc ) -import Outputable ( panic ) -- | Pretty print a declaration ppDecl :: Bool -- ^ print summary info only @@ -75,14 +75,14 @@ ppLFunSig :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> [Located DocName] -> LHsType DocNameI -> [(DocName, Fixity)] -> Splice -> Unicode -> Maybe Package -> Qualification -> Html ppLFunSig summary links loc doc lnames lty fixities splice unicode pkg qual = - ppFunSig summary links loc doc (map unLoc lnames) lty fixities + ppFunSig summary links loc noHtml doc (map unLoc lnames) lty fixities splice unicode pkg qual -ppFunSig :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> +ppFunSig :: Bool -> LinksInfo -> SrcSpan -> Html -> DocForDecl DocName -> [DocName] -> LHsType DocNameI -> [(DocName, Fixity)] -> Splice -> Unicode -> Maybe Package -> Qualification -> Html -ppFunSig summary links loc doc docnames typ fixities splice unicode pkg qual = - ppSigLike summary links loc mempty doc docnames fixities (unLoc typ, pp_typ) +ppFunSig summary links loc leader doc docnames typ fixities splice unicode pkg qual = + ppSigLike summary links loc leader doc docnames fixities (unLoc typ, pp_typ) splice unicode pkg qual HideEmptyContexts where pp_typ = ppLType unicode qual HideEmptyContexts typ @@ -133,8 +133,8 @@ ppTypeOrFunSig summary links loc docnames typ (doc, argDocs) (pref1, pref2, sep) curname = getName <$> listToMaybe docnames --- This splits up a type signature along `->` and adds docs (when they exist) to --- the arguments. +-- | This splits up a type signature along @->@ and adds docs (when they exist) +-- to the arguments. -- -- If one passes in a list of the available subdocs, any top-level `HsRecTy` -- found will be expanded out into their fields. @@ -152,9 +152,7 @@ ppSubSigLike unicode qual typ argDocs subdocs sep emptyCtxts = do_args 0 sep typ do_args :: Int -> Html -> HsType DocNameI -> [SubDecl] do_args n leader (HsForAllTy _ fvf tvs ltype) - = do_largs n leader' ltype - where - leader' = leader <+> ppForAll tvs unicode qual fvf + = do_largs n (leader <+> ppForAllPart unicode qual tvs fvf) ltype do_args n leader (HsQualTy _ lctxt ltype) | null (unLoc lctxt) @@ -188,22 +186,6 @@ ppSubSigLike unicode qual typ argDocs subdocs sep emptyCtxts = do_args 0 sep typ gadtOpen = toHtml "{" - -ppForAll :: [LHsTyVarBndr DocNameI] -> Unicode -> Qualification -> ForallVisFlag - -> Html -ppForAll tvs unicode qual fvf = - case [ppKTv n k | L _ (KindedTyVar _ (L _ n) k) <- tvs] of - [] -> noHtml - ts -> forallSymbol unicode <+> hsep ts +++ ppForAllSeparator unicode fvf - where ppKTv n k = parens $ - ppTyName (getName n) <+> dcolon unicode <+> ppLKind unicode qual k - -ppForAllSeparator :: Unicode -> ForallVisFlag -> Html -ppForAllSeparator unicode fvf = - case fvf of - ForallVis -> spaceHtml +++ arrow unicode - ForallInvis -> dot - ppFixities :: [(DocName, Fixity)] -> Qualification -> Html ppFixities [] _ = noHtml ppFixities fs qual = foldr1 (+++) (map ppFix uniq_fs) +++ rightEdge @@ -236,7 +218,7 @@ ppFor :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> Splice -> Unicode -> Maybe Package -> Qualification -> Html ppFor summary links loc doc (ForeignImport _ (L _ name) typ _) fixities splice unicode pkg qual - = ppFunSig summary links loc doc [name] (hsSigTypeI typ) fixities splice unicode pkg qual + = ppFunSig summary links loc noHtml doc [name] (hsSigTypeI typ) fixities splice unicode pkg qual ppFor _ _ _ _ _ _ _ _ _ _ = error "ppFor" @@ -268,10 +250,6 @@ ppTypeSig summary nms pp_ty unicode = htmlNames = intersperse (stringToHtml ", ") $ map (ppBinder summary) nms -ppTyName :: Name -> Html -ppTyName = ppName Prefix - - ppSimpleSig :: LinksInfo -> Splice -> Unicode -> Qualification -> HideEmptyContexts -> SrcSpan -> [DocName] -> HsType DocNameI -> Html @@ -518,7 +496,7 @@ ppShortClassDecl summary links (ClassDecl { tcdCtxt = lctxt, tcdLName = lname, t -- ToDo: add associated type defaults - [ ppFunSig summary links loc doc names (hsSigTypeI typ) + [ ppFunSig summary links loc noHtml doc names (hsSigTypeI typ) [] splice unicode pkg qual | L _ (ClassOpSig _ False lnames typ) <- sigs , let doc = lookupAnySubdoc (head names) subdocs @@ -539,8 +517,9 @@ ppClassDecl :: Bool -> LinksInfo -> [DocInstance DocNameI] -> [(DocName, Fixity) -> [(DocName, DocForDecl DocName)] -> TyClDecl DocNameI -> Splice -> Unicode -> Maybe Package -> Qualification -> Html ppClassDecl summary links instances fixities loc d subdocs - decl@(ClassDecl { tcdCtxt = lctxt, tcdLName = lname, tcdTyVars = ltyvars - , tcdFDs = lfds, tcdSigs = lsigs, tcdATs = ats }) + decl@(ClassDecl { tcdCtxt = lctxt, tcdLName = lname@(L _ nm) + , tcdTyVars = ltyvars, tcdFDs = lfds, tcdSigs = lsigs + , tcdATs = ats, tcdATDefs = atsDefs }) splice unicode pkg qual | summary = ppShortClassDecl summary links decl loc subdocs splice unicode pkg qual | otherwise = classheader +++ docSection curname pkg qual d @@ -557,28 +536,63 @@ ppClassDecl summary links instances fixities loc d subdocs -- Only the fixity relevant to the class header fixs = ppFixities [ f | f@(n,_) <- fixities, n == unLoc lname ] qual - nm = tcdName decl - hdr = ppClassHdr summary lctxt (unLoc lname) ltyvars lfds - -- ToDo: add assocatied typ defaults - atBit = subAssociatedTypes [ ppAssocType summary links doc at subfixs splice unicode pkg qual - | at <- ats - , let n = unL . fdLName $ unL at - doc = lookupAnySubdoc (unL $ fdLName $ unL at) subdocs - subfixs = [ f | f@(n',_) <- fixities, n == n' ] ] - - methodBit = subMethods [ ppFunSig summary links loc doc [name] (hsSigTypeI typ) - subfixs splice unicode pkg qual - | L _ (ClassOpSig _ _ lnames typ) <- lsigs - , name <- map unLoc lnames - , let doc = lookupAnySubdoc name subdocs - subfixs = [ f | f@(n',_) <- fixities - , name == n' ] - ] - -- N.B. taking just the first name is ok. Signatures with multiple names - -- are expanded so that each name gets its own signature. + -- Associated types + atBit = subAssociatedTypes + [ ppAssocType summary links doc at subfixs splice unicode pkg qual + <+> + subDefaults (maybeToList defTys) + | at <- ats + , let name = unL . fdLName $ unL at + doc = lookupAnySubdoc name subdocs + subfixs = filter ((== name) . fst) fixities + defTys = (declElem . ppDefaultAssocTy name) <$> lookupDAT name + ] + + -- Default associated types + ppDefaultAssocTy n (vs,rhs) = hsep + [ keyword "type", ppAppNameTypeArgs n vs unicode qual, equals + , ppType unicode qual HideEmptyContexts (unLoc rhs) + ] + lookupDAT name = Map.lookup (getName name) defaultAssocTys + defaultAssocTys = Map.fromList + [ (getName name, (vs, typ)) + | L _ (TyFamInstDecl (HsIB _ (FamEqn { feqn_rhs = typ + , feqn_tycon = L _ name + , feqn_pats = vs }))) <- atsDefs + ] + + -- Methods + methodBit = subMethods + [ ppFunSig summary links loc noHtml doc [name] (hsSigTypeI typ) + subfixs splice unicode pkg qual + <+> + subDefaults (maybeToList defSigs) + | ClassOpSig _ False lnames typ <- sigs + , name <- map unLoc lnames + , let doc = lookupAnySubdoc name subdocs + subfixs = filter ((== name) . fst) fixities + defSigs = ppDefaultFunSig name <$> lookupDM name + ] + -- N.B. taking just the first name is ok. Signatures with multiple names + -- are expanded so that each name gets its own signature. + + -- Default methods + ppDefaultFunSig n (t, d') = ppFunSig summary links loc (keyword "default") + d' [n] (hsSigTypeI t) [] splice unicode pkg qual + + lookupDM name = Map.lookup (getOccString name) defaultMethods + defaultMethods = Map.fromList + [ (nameStr, (typ, doc)) + | ClassOpSig _ True lnames typ <- sigs + , name <- map unLoc lnames + , let doc = noDocForDecl -- TODO: get docs for method defaults + nameStr = getOccString name + ] + + -- Minimal complete definition minimalBit = case [ s | MinimalSig _ _ (L _ s) <- sigs ] of -- Miminal complete definition = every shown method And xs : _ | sort [getName n | L _ (Var (L _ n)) <- xs] == @@ -587,7 +601,7 @@ ppClassDecl summary links instances fixities loc d subdocs -- Minimal complete definition = the only shown method Var (L _ n) : _ | [getName n] == - [getName n' | L _ (ClassOpSig _ _ ns _) <- lsigs, L _ n' <- ns] + [getName n' | ClassOpSig _ _ ns _ <- sigs, L _ n' <- ns] -> noHtml -- Minimal complete definition = nothing @@ -602,6 +616,7 @@ ppClassDecl summary links instances fixities loc d subdocs where wrap | p = parens | otherwise = id ppMinimal p (Parens x) = ppMinimal p (unLoc x) + -- Instances instancesBit = ppInstances links (OriginClass nm) instances splice unicode pkg qual @@ -828,24 +843,23 @@ ppShortConstrParts :: Bool -> Bool -> ConDecl DocNameI -> Unicode -> Qualificati ppShortConstrParts summary dataInst con unicode qual = case con of ConDeclH98{ con_args = det - , con_ex_tvs = vars + , con_ex_tvs = tyVars + , con_forall = L _ forall_ , con_mb_cxt = cxt - } -> let tyVars = map (getName . hsLTyVarNameI) vars - context = unLoc (fromMaybe (noLoc []) cxt) - forall_ = False + } -> let context = unLoc (fromMaybe (noLoc []) cxt) header_ = ppConstrHdr forall_ tyVars context unicode qual in case det of -- Prefix constructor, e.g. 'Just a' PrefixCon args -> - ( header_ +++ hsep (ppOcc : map (ppLParendType unicode qual HideEmptyContexts) args) + ( header_ <+> hsep (ppOcc : map (ppLParendType unicode qual HideEmptyContexts) args) , noHtml , noHtml ) -- Record constructor, e.g. 'Identity { runIdentity :: a }' RecCon (L _ fields) -> - ( header_ +++ ppOcc <+> char '{' + ( header_ <+> ppOcc <+> char '{' , shortSubDecls dataInst [ ppShortField summary unicode qual field | L _ field <- fields ] @@ -854,7 +868,7 @@ ppShortConstrParts summary dataInst con unicode qual -- Infix constructor, e.g. 'a :| [a]' InfixCon arg1 arg2 -> - ( header_ +++ hsep [ ppLParendType unicode qual HideEmptyContexts arg1 + ( header_ <+> hsep [ ppLParendType unicode qual HideEmptyContexts arg1 , ppOccInfix , ppLParendType unicode qual HideEmptyContexts arg2 ] @@ -902,28 +916,27 @@ ppSideBySideConstr subdocs fixities unicode pkg qual (L _ con) decl = case con of ConDeclH98{ con_args = det - , con_ex_tvs = vars + , con_ex_tvs = tyVars + , con_forall = L _ forall_ , con_mb_cxt = cxt - } -> let tyVars = map (getName . hsLTyVarNameI) vars - context = unLoc (fromMaybe (noLoc []) cxt) - forall_ = False + } -> let context = unLoc (fromMaybe (noLoc []) cxt) header_ = ppConstrHdr forall_ tyVars context unicode qual in case det of -- Prefix constructor, e.g. 'Just a' PrefixCon args - | hasArgDocs -> header_ +++ ppOcc <+> fixity - | otherwise -> hsep [ header_ +++ ppOcc + | hasArgDocs -> header_ <+> ppOcc <+> fixity + | otherwise -> hsep [ header_ <+> ppOcc , hsep (map (ppLParendType unicode qual HideEmptyContexts) args) , fixity ] -- Record constructor, e.g. 'Identity { runIdentity :: a }' - RecCon _ -> header_ +++ ppOcc <+> fixity + RecCon _ -> header_ <+> ppOcc <+> fixity -- Infix constructor, e.g. 'a :| [a]' InfixCon arg1 arg2 - | hasArgDocs -> header_ +++ ppOcc <+> fixity - | otherwise -> hsep [ header_ +++ ppLParendType unicode qual HideEmptyContexts arg1 + | hasArgDocs -> header_ <+> ppOcc <+> fixity + | otherwise -> hsep [ header_ <+> ppLParendType unicode qual HideEmptyContexts arg1 , ppOccInfix , ppLParendType unicode qual HideEmptyContexts arg2 , fixity @@ -976,17 +989,17 @@ ppSideBySideConstr subdocs fixities unicode pkg qual (L _ con) -- ppConstrHdr is for (non-GADT) existentials constructors' syntax -ppConstrHdr :: Bool -- ^ print explicit foralls - -> [Name] -- ^ type variables - -> HsContext DocNameI -- ^ context - -> Unicode -> Qualification -> Html +ppConstrHdr + :: Bool -- ^ print explicit foralls + -> [LHsTyVarBndr DocNameI] -- ^ type variables + -> HsContext DocNameI -- ^ context + -> Unicode -> Qualification + -> Html ppConstrHdr forall_ tvs ctxt unicode qual = ppForall +++ ppCtxt where ppForall | null tvs || not forall_ = noHtml - | otherwise = forallSymbol unicode - <+> hsep (map (ppName Prefix) tvs) - <+> toHtml ". " + | otherwise = ppForAllPart unicode qual tvs ForallInvis ppCtxt | null ctxt = noHtml @@ -1159,10 +1172,14 @@ ppPatSigType :: Unicode -> Qualification -> LHsType DocNameI -> Html ppPatSigType unicode qual typ = let emptyCtxts = patSigContext typ in ppLType unicode qual emptyCtxts typ -ppForAllPart :: Unicode -> Qualification -> ForallVisFlag -> [LHsTyVarBndr DocNameI] -> Html -ppForAllPart unicode qual fvf tvs = - hsep (forallSymbol unicode : ppTyVars unicode qual tvs) +++ - ppForAllSeparator unicode fvf + +ppForAllPart :: Unicode -> Qualification -> [LHsTyVarBndr DocNameI] -> ForallVisFlag -> Html +ppForAllPart unicode qual tvs fvf = hsep (forallSymbol unicode : tvs') +++ fv + where + tvs' = ppTyVars unicode qual tvs + fv = case fvf of + ForallVis -> spaceHtml +++ arrow unicode + ForallInvis -> dot ppr_mono_lty :: LHsType DocNameI -> Unicode -> Qualification -> HideEmptyContexts -> Html ppr_mono_lty ty = ppr_mono_ty (unLoc ty) @@ -1170,7 +1187,7 @@ ppr_mono_lty ty = ppr_mono_ty (unLoc ty) ppr_mono_ty :: HsType DocNameI -> Unicode -> Qualification -> HideEmptyContexts -> Html ppr_mono_ty (HsForAllTy _ fvf tvs ty) unicode qual emptyCtxts - = ppForAllPart unicode qual fvf tvs <+> ppr_mono_lty ty unicode qual emptyCtxts + = ppForAllPart unicode qual tvs fvf <+> ppr_mono_lty ty unicode qual emptyCtxts ppr_mono_ty (HsQualTy _ ctxt ty) unicode qual emptyCtxts = ppLContext ctxt unicode qual emptyCtxts <+> ppr_mono_lty ty unicode qual emptyCtxts @@ -1195,7 +1212,7 @@ ppr_mono_ty (HsTupleTy _ con tys) u q _ = ppr_mono_ty (HsSumTy _ tys) u q _ = sumParens (map (ppLType u q HideEmptyContexts) tys) ppr_mono_ty (HsKindSig _ ty kind) u q e = - parens (ppr_mono_lty ty u q e <+> dcolon u <+> ppLKind u q kind) + ppr_mono_lty ty u q e <+> dcolon u <+> ppLKind u q kind ppr_mono_ty (HsListTy _ ty) u q _ = brackets (ppr_mono_lty ty u q HideEmptyContexts) ppr_mono_ty (HsIParamTy _ (L _ n) ty) u q _ = ppIPName n <+> dcolon u <+> ppr_mono_lty ty u q HideEmptyContexts diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs index 09aabc0c..edab4b16 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -171,18 +171,18 @@ flatten x = [x] -- extract/append the underlying 'Doc' and convert it to 'Html'. For -- 'CollapsingHeader', we attach extra info to the generated 'Html' -- that allows us to expand/collapse the content. -hackMarkup :: DocMarkup id Html -> Maybe Package -> Hack (ModuleName, OccName) id -> Html +hackMarkup :: DocMarkup id Html -> Maybe Package -> Hack (Wrap (ModuleName, OccName)) id -> Html hackMarkup fmt' currPkg h' = let (html, ms) = hackMarkup' fmt' h' in html +++ renderMeta fmt' currPkg (metaConcat ms) where - hackMarkup' :: DocMarkup id Html -> Hack (ModuleName, OccName) id + hackMarkup' :: DocMarkup id Html -> Hack (Wrap (ModuleName, OccName)) id -> (Html, [Meta]) hackMarkup' fmt h = case h of UntouchedDoc d -> (markup fmt $ _doc d, [_meta d]) CollapsingHeader (Header lvl titl) par n nm -> let id_ = makeAnchorId $ "ch:" ++ fromMaybe "noid:" nm ++ show n - col' = collapseControl id_ "caption" + col' = collapseControl id_ "subheading" summary = thesummary ! [ theclass "hide-when-js-enabled" ] << "Expand" instTable contents = collapseDetails id_ DetailsClosed (summary +++ contents) lvs = zip [1 .. ] [h1, h2, h3, h4, h5, h6] @@ -206,7 +206,7 @@ renderMeta _ _ _ = noHtml -- | Goes through 'hackMarkup' to generate the 'Html' rather than -- skipping straight to 'markup': this allows us to employ XHtml -- specific hacks to the tree first. -markupHacked :: DocMarkup id Html +markupHacked :: DocMarkup (Wrap id) Html -> Maybe Package -- this package -> Maybe String -> MDoc id @@ -220,7 +220,7 @@ docToHtml :: Maybe String -- ^ Name of the thing this doc is for. See -> Maybe Package -- ^ Current package -> Qualification -> MDoc DocName -> Html docToHtml n pkg qual = markupHacked fmt pkg n . cleanup - where fmt = parHtmlMarkup qual True (ppDocName qual Raw) + where fmt = parHtmlMarkup qual True (ppWrappedDocName qual Raw) -- | Same as 'docToHtml' but it doesn't insert the 'anchor' element -- in links. This is used to generate the Contents box elements. @@ -228,16 +228,16 @@ docToHtmlNoAnchors :: Maybe String -- ^ See 'toHack' -> Maybe Package -- ^ Current package -> Qualification -> MDoc DocName -> Html docToHtmlNoAnchors n pkg qual = markupHacked fmt pkg n . cleanup - where fmt = parHtmlMarkup qual False (ppDocName qual Raw) + where fmt = parHtmlMarkup qual False (ppWrappedDocName qual Raw) origDocToHtml :: Maybe Package -> Qualification -> MDoc Name -> Html origDocToHtml pkg qual = markupHacked fmt pkg Nothing . cleanup - where fmt = parHtmlMarkup qual True (const $ ppName Raw) + where fmt = parHtmlMarkup qual True (const (ppWrappedName Raw)) rdrDocToHtml :: Maybe Package -> Qualification -> MDoc RdrName -> Html rdrDocToHtml pkg qual = markupHacked fmt pkg Nothing . cleanup - where fmt = parHtmlMarkup qual True (const ppRdrName) + where fmt = parHtmlMarkup qual True (const (ppRdrName . unwrap)) docElement :: (Html -> Html) -> Html -> Html @@ -273,7 +273,7 @@ cleanup = overDoc (markup fmtUnParagraphLists) unParagraph (DocParagraph d) = d unParagraph doc = doc - fmtUnParagraphLists :: DocMarkup a (Doc a) + fmtUnParagraphLists :: DocMarkup (Wrap a) (Doc a) fmtUnParagraphLists = idMarkup { markupUnorderedList = DocUnorderedList . map unParagraph, markupOrderedList = DocOrderedList . map unParagraph diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs index 25d8b07a..4535b897 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs @@ -35,6 +35,7 @@ module Haddock.Backends.Xhtml.Layout ( subInstances, subOrphanInstances, subInstHead, subInstDetails, subFamInstDetails, subMethods, + subDefaults, subMinimal, topDeclElem, declElem, @@ -259,6 +260,9 @@ instAnchorId iid = makeAnchorId $ "i:" ++ iid subMethods :: [Html] -> Html subMethods = divSubDecls "methods" "Methods" . subBlock +subDefaults :: [Html] -> Html +subDefaults = divSubDecls "default" "" . subBlock + subMinimal :: Html -> Html subMinimal = divSubDecls "minimal" "Minimal complete definition" . Just . declElem diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Names.hs b/haddock-api/src/Haddock/Backends/Xhtml/Names.hs index 574045e0..6a047747 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Names.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Names.hs @@ -13,7 +13,8 @@ module Haddock.Backends.Xhtml.Names ( ppName, ppDocName, ppLDocName, ppRdrName, ppUncheckedLink, ppBinder, ppBinderInfix, ppBinder', - ppModule, ppModuleRef, ppIPName, linkId, Notation(..) + ppModule, ppModuleRef, ppIPName, linkId, Notation(..), + ppWrappedDocName, ppWrappedName, ) where @@ -24,7 +25,7 @@ import Haddock.Utils import Text.XHtml hiding ( name, p, quote ) import qualified Data.Map as M -import qualified Data.List as List +import Data.List ( stripPrefix ) import GHC hiding (LexicalFixity(..)) import Name @@ -49,9 +50,11 @@ ppIPName :: HsIPName -> Html ppIPName = toHtml . ('?':) . unpackFS . hsIPNameFS -ppUncheckedLink :: Qualification -> (ModuleName, OccName) -> Html -ppUncheckedLink _ (mdl, occ) = linkIdOcc' mdl (Just occ) << ppOccName occ -- TODO: apply ppQualifyName - +ppUncheckedLink :: Qualification -> Wrap (ModuleName, OccName) -> Html +ppUncheckedLink _ x = linkIdOcc' mdl (Just occ) << occHtml + where + (mdl, occ) = unwrap x + occHtml = toHtml (showWrapped (occNameString . snd) x) -- TODO: apply ppQualifyName -- The Bool indicates if it is to be rendered in infix notation ppLDocName :: Qualification -> Notation -> Located DocName -> Html @@ -68,6 +71,19 @@ ppDocName qual notation insertAnchors docName = ppQualifyName qual notation name (nameModule name) | otherwise -> ppName notation name + +ppWrappedDocName :: Qualification -> Notation -> Bool -> Wrap DocName -> Html +ppWrappedDocName qual notation insertAnchors docName = case docName of + Unadorned n -> ppDocName qual notation insertAnchors n + Parenthesized n -> ppDocName qual Prefix insertAnchors n + Backticked n -> ppDocName qual Infix insertAnchors n + +ppWrappedName :: Notation -> Wrap Name -> Html +ppWrappedName notation docName = case docName of + Unadorned n -> ppName notation n + Parenthesized n -> ppName Prefix n + Backticked n -> ppName Infix n + -- | Render a name depending on the selected qualification mode ppQualifyName :: Qualification -> Notation -> Name -> Module -> Html ppQualifyName qual notation name mdl = @@ -79,7 +95,7 @@ ppQualifyName qual notation name mdl = then ppName notation name else ppFullQualName notation mdl name RelativeQual localmdl -> - case List.stripPrefix (moduleString localmdl) (moduleString mdl) of + case stripPrefix (moduleString localmdl) (moduleString mdl) of -- local, A.x -> x Just [] -> ppName notation name -- sub-module, A.B.x -> B.x diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs b/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs index 10d6ab10..b1d64acd 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs @@ -58,7 +58,7 @@ standardTheme :: FilePath -> IO PossibleThemes standardTheme libDir = liftM (liftEither (take 1)) (defaultThemes libDir) --- | Default themes that are part of Haddock; added with --default-themes +-- | Default themes that are part of Haddock; added with @--built-in-themes@ -- The first theme in this list is considered the standard theme. -- Themes are "discovered" by scanning the html sub-dir of the libDir, -- and looking for directories with the extension .theme or .std-theme. diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 6e2c0b9f..d5fa3667 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -44,7 +44,7 @@ import TysWiredIn ( eqTyConName, listTyConName, liftedTypeKindTyConName import PrelNames ( hasKey, eqTyConKey, ipClassKey, tYPETyConKey , liftedRepDataConKey ) import Unique ( getUnique ) -import Util ( chkAppend,dropList, filterByList, filterOut ) +import Util ( chkAppend, dropList, filterByList, filterOut ) import Var import VarSet @@ -150,8 +150,7 @@ synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) = let name = synifyName tc args_types_only = filterOutInvisibleTypes tc args typats = map (synifyType WithinType []) args_types_only - annot_typats = zipWith3 annotHsType (mkIsPolyTvs fam_tvs) - args_types_only typats + annot_typats = zipWith3 annotHsType args_poly args_types_only typats hs_rhs = synifyType WithinType [] rhs in HsIB { hsib_ext = map tyVarName tkvs , hsib_body = FamEqn { feqn_ext = noExtField @@ -162,7 +161,7 @@ synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) , feqn_fixity = synifyFixity name , feqn_rhs = hs_rhs } } where - fam_tvs = tyConVisibleTyVars tc + args_poly = tyConArgsPolyKinded tc synifyAxiom :: CoAxiom br -> Either ErrMsg (HsDecl GhcRn) synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) @@ -469,17 +468,26 @@ annotHsType True ty hs_ty in noLoc (HsKindSig noExtField hs_ty hs_ki) annotHsType _ _ hs_ty = hs_ty --- | For every type variable in the input, --- report whether or not the tv is poly-kinded. This is used to eventually --- feed into 'annotHsType'. -mkIsPolyTvs :: [TyVar] -> [Bool] -mkIsPolyTvs = map is_poly_tv +-- | For every argument type that a type constructor accepts, +-- report whether or not the argument is poly-kinded. This is used to +-- eventually feed into 'annotThType'. +tyConArgsPolyKinded :: TyCon -> [Bool] +tyConArgsPolyKinded tc = + map (is_poly_ty . tyVarKind) tc_vis_tvs + ++ map (is_poly_ty . tyCoBinderType) tc_res_kind_vis_bndrs + ++ repeat True where - is_poly_tv tv = not $ + is_poly_ty :: Type -> Bool + is_poly_ty ty = not $ isEmptyVarSet $ filterVarSet isTyVar $ - tyCoVarsOfType $ - tyVarKind tv + tyCoVarsOfType ty + + tc_vis_tvs :: [TyVar] + tc_vis_tvs = tyConVisibleTyVars tc + + tc_res_kind_vis_bndrs :: [TyCoBinder] + tc_res_kind_vis_bndrs = filter isVisibleBinder $ fst $ splitPiTys $ tyConResKind tc --states of what to do with foralls: data SynifyTypeState @@ -773,8 +781,8 @@ synifyInstHead (vs, preds, cls, types) = specializeInstHead $ InstHead cls_tycon = classTyCon cls ts = filterOutInvisibleTypes cls_tycon types ts' = map (synifyType WithinType vs) ts - annot_ts = zipWith3 annotHsType is_poly_tvs ts ts' - is_poly_tvs = mkIsPolyTvs (tyConVisibleTyVars cls_tycon) + annot_ts = zipWith3 annotHsType args_poly ts ts' + args_poly = tyConArgsPolyKinded cls_tycon synifyClsIdSig = synifyIdSig ShowRuntimeRep DeleteTopLevelQuantification vs -- Convert a family instance, this could be a type family or data family @@ -813,8 +821,8 @@ synifyFamInst fi opaque = do ts = filterOutInvisibleTypes fam_tc eta_expanded_lhs synifyTypes = map (synifyType WithinType []) ts' = synifyTypes ts - annot_ts = zipWith3 annotHsType is_poly_tvs ts ts' - is_poly_tvs = mkIsPolyTvs (tyConVisibleTyVars fam_tc) + annot_ts = zipWith3 annotHsType args_poly ts ts' + args_poly = tyConArgsPolyKinded fam_tc {- Note [Invariant: Never expand type synonyms] diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index cef1e6e9..6577e08f 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -38,7 +38,8 @@ import Var ( VarBndr(..), TyVarBinder, tyVarKind, updateTyVarKind, isInvisibleArgFlag ) import VarSet ( VarSet, emptyVarSet ) import VarEnv ( TyVarEnv, extendVarEnv, elemVarEnv, emptyVarEnv ) -import TyCoRep ( Type(..), isRuntimeRepVar ) +import TyCoRep ( Type(..) ) +import Type ( isRuntimeRepVar ) import TysWiredIn( liftedRepDataConTyCon ) import StringBuffer ( StringBuffer ) @@ -260,6 +261,8 @@ getGADTConTypeG (XConDecl nec) = noExtCon nec data Precedence = PREC_TOP -- ^ precedence of 'type' production in GHC's parser + | PREC_SIG -- ^ explicit type signature + | PREC_CTX -- ^ Used for single contexts, eg. ctx => type -- (as opposed to (ctx1, ctx2) => type) @@ -286,18 +289,21 @@ reparenTypePrec = go go _ (HsBangTy x b ty) = HsBangTy x b (reparenLType ty) go _ (HsTupleTy x con tys) = HsTupleTy x con (map reparenLType tys) go _ (HsSumTy x tys) = HsSumTy x (map reparenLType tys) - go _ (HsKindSig x ty kind) = HsKindSig x (reparenLType ty) (reparenLType kind) go _ (HsListTy x ty) = HsListTy x (reparenLType ty) go _ (HsRecTy x flds) = HsRecTy x (map (fmap reparenConDeclField) flds) go p (HsDocTy x ty d) = HsDocTy x (goL p ty) d go _ (HsExplicitListTy x p tys) = HsExplicitListTy x p (map reparenLType tys) go _ (HsExplicitTupleTy x tys) = HsExplicitTupleTy x (map reparenLType tys) + go p (HsKindSig x ty kind) + = paren p PREC_SIG $ HsKindSig x (goL PREC_SIG ty) (goL PREC_SIG kind) go p (HsIParamTy x n ty) - = paren p PREC_CTX $ HsIParamTy x n (reparenLType ty) + = paren p PREC_SIG $ HsIParamTy x n (reparenLType ty) go p (HsForAllTy x fvf tvs ty) = paren p PREC_CTX $ HsForAllTy x fvf (map (fmap reparenTyVar) tvs) (reparenLType ty) go p (HsQualTy x ctxt ty) - = paren p PREC_FUN $ HsQualTy x (fmap (map reparenLType) ctxt) (reparenLType ty) + = let p' [_] = PREC_CTX + p' _ = PREC_TOP -- parens will get added anyways later... + in paren p PREC_CTX $ HsQualTy x (fmap (\xs -> map (goL (p' xs)) xs) ctxt) (goL PREC_TOP ty) go p (HsFunTy x ty1 ty2) = paren p PREC_FUN $ HsFunTy x (goL PREC_FUN ty1) (goL PREC_TOP ty2) go p (HsAppTy x fun_ty arg_ty) diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs index 998116f4..c2c0d733 100644 --- a/haddock-api/src/Haddock/Interface.hs +++ b/haddock-api/src/Haddock/Interface.hs @@ -47,7 +47,6 @@ import Control.Exception (evaluate) import Data.List import qualified Data.Map as Map import qualified Data.Set as Set -import Distribution.Verbosity import Text.Printf import Module (mkModuleSet, emptyModuleSet, unionModuleSet, ModuleSet) @@ -61,6 +60,7 @@ import Name (nameIsFromExternalPackage, nameOccName) import OccName (isTcOcc) import RdrName (unQualOK, gre_name, globalRdrEnvElts) import ErrUtils (withTimingD) +import DynamicLoading (initializePlugins) #if defined(mingw32_HOST_OS) import System.IO @@ -150,7 +150,13 @@ createIfaces verbosity modules flags instIfaceMap = do processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe (Interface, ModuleSet)) processModule verbosity modsum flags modMap instIfaceMap = do out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modsum) ++ "..." - tm <- {-# SCC "parse/typecheck/load" #-} loadModule =<< typecheckModule =<< parseModule modsum + + -- Since GHC 8.6, plugins are initialized on a per module basis + hsc_env' <- getSession + dynflags' <- liftIO (initializePlugins hsc_env' (GHC.ms_hspp_opts modsum)) + let modsum' = modsum { ms_hspp_opts = dynflags' } + + tm <- {-# SCC "parse/typecheck/load" #-} loadModule =<< typecheckModule =<< parseModule modsum' if not $ isBootSummary modsum then do out verbosity verbose "Creating interface..." diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 361c91de..d5cbdaf5 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -84,8 +84,9 @@ createInterface tm flags modMap instIfaceMap = do (TcGblEnv { tcg_rdr_env = gre , tcg_warns = warnings - , tcg_exports = all_exports + , tcg_exports = all_exports0 }, md) = tm_internals_ tm + all_local_avails = gresToAvailInfo . filter isLocalGRE . globalRdrEnvElts $ gre -- The 'pkgName' is necessary to decide what package to mention in "@since" -- annotations. Not having it is not fatal though. @@ -112,9 +113,9 @@ createInterface tm flags modMap instIfaceMap = do let declsWithDocs = topDecls group_ exports0 = fmap (map (first unLoc)) mayExports - exports - | OptIgnoreExports `elem` opts = Nothing - | otherwise = exports0 + (all_exports, exports) + | OptIgnoreExports `elem` opts = (all_local_avails, Nothing) + | otherwise = (all_exports0, exports0) unrestrictedImportedMods -- module re-exports are only possible with @@ -126,8 +127,8 @@ createInterface tm flags modMap instIfaceMap = do fixMap = mkFixMap group_ (decls, _) = unzip declsWithDocs localInsts = filter (nameIsLocalOrFrom sem_mdl) - $ map getName instances - ++ map getName fam_instances + $ map getName fam_instances + ++ map getName instances -- Locations of all TH splices splices = [ l | L l (SpliceD _ _) <- hsmodDecls hsm ] diff --git a/haddock-api/src/Haddock/Interface/Json.hs b/haddock-api/src/Haddock/Interface/Json.hs index 636d3e19..a9834fa0 100644 --- a/haddock-api/src/Haddock/Interface/Json.hs +++ b/haddock-api/src/Haddock/Interface/Json.hs @@ -62,7 +62,10 @@ jsonMDoc MetaDoc{..} = ] jsonDoc :: Doc Name -> JsonDoc -jsonDoc doc = jsonString (show (bimap (moduleNameString . fst) nameStableString doc)) +jsonDoc doc = jsonString (show (bimap showModName showName doc)) + where + showModName = showWrapped (moduleNameString . fst) + showName = showWrapped nameStableString jsonModule :: Module -> JsonDoc jsonModule = JSString . moduleStableString diff --git a/haddock-api/src/Haddock/Interface/LexParseRn.hs b/haddock-api/src/Haddock/Interface/LexParseRn.hs index 59ad4fdf..0b40ed3c 100644 --- a/haddock-api/src/Haddock/Interface/LexParseRn.hs +++ b/haddock-api/src/Haddock/Interface/LexParseRn.hs @@ -19,9 +19,9 @@ module Haddock.Interface.LexParseRn , processModuleHeader ) where -import Avail import Control.Arrow import Control.Monad +import Data.Functor (($>)) import Data.List import Data.Ord import Documentation.Haddock.Doc (metaDocConcat) @@ -34,8 +34,8 @@ import Haddock.Types import Name import Outputable ( showPpr, showSDoc ) import RdrName +import RdrHsSyn (setRdrNameSpace) import EnumSet -import RnEnv (dataTcOccs) processDocStrings :: DynFlags -> Maybe Package -> GlobalRdrEnv -> [HsDocString] -> ErrMsgM (Maybe (MDoc Name)) @@ -89,24 +89,38 @@ processModuleHeader dflags pkgName gre safety mayStr = do -- fallbacks in case we can't locate the identifiers. -- -- See the comments in the source for implementation commentary. -rename :: DynFlags -> GlobalRdrEnv -> Doc RdrName -> ErrMsgM (Doc Name) +rename :: DynFlags -> GlobalRdrEnv -> Doc NsRdrName -> ErrMsgM (Doc Name) rename dflags gre = rn where rn d = case d of DocAppend a b -> DocAppend <$> rn a <*> rn b DocParagraph doc -> DocParagraph <$> rn doc - DocIdentifier x -> do + DocIdentifier i -> do + let NsRdrName ns x = unwrap i + occ = rdrNameOcc x + isValueName = isDataOcc occ || isVarOcc occ + + let valueNsChoices | isValueName = [x] + | otherwise = [] -- is this ever possible? + typeNsChoices | isValueName = [setRdrNameSpace x tcName] + | otherwise = [x] + -- Generate the choices for the possible kind of thing this - -- is. - let choices = dataTcOccs x + -- is. We narrow down the possibilities with the namespace (if + -- there is one). + let choices = case ns of + Value -> valueNsChoices + Type -> typeNsChoices + None -> valueNsChoices ++ typeNsChoices -- Lookup any GlobalRdrElts that match the choices. case concatMap (\c -> lookupGRE_RdrName c gre) choices of -- We found no names in the env so we start guessing. [] -> case choices of - -- This shouldn't happen as 'dataTcOccs' always returns at least its input. - [] -> pure (DocMonospaced (DocString (showPpr dflags x))) + -- The only way this can happen is if a value namespace was + -- specified on something that cannot be a value. + [] -> invalidValue dflags i -- There was nothing in the environment so we need to -- pick some default from what's available to us. We @@ -116,14 +130,14 @@ rename dflags gre = rn -- type constructor names (such as in #253). So now we -- only get type constructor links if they are actually -- in scope. - a:_ -> outOfScope dflags a + a:_ -> outOfScope dflags ns (i $> a) -- There is only one name in the environment that matches so -- use it. - [a] -> pure (DocIdentifier (gre_name a)) + [a] -> pure (DocIdentifier (i $> gre_name a)) -- There are multiple names available. - gres -> ambiguous dflags x gres + gres -> ambiguous dflags i gres DocWarning doc -> DocWarning <$> rn doc DocEmphasis doc -> DocEmphasis <$> rn doc @@ -155,19 +169,25 @@ rename dflags gre = rn -- users shouldn't rely on this doing the right thing. See tickets -- #253 and #375 on the confusion this causes depending on which -- default we pick in 'rename'. -outOfScope :: DynFlags -> RdrName -> ErrMsgM (Doc a) -outOfScope dflags x = - case x of - Unqual occ -> warnAndMonospace occ - Qual mdl occ -> pure (DocIdentifierUnchecked (mdl, occ)) - Orig _ occ -> warnAndMonospace occ - Exact name -> warnAndMonospace name -- Shouldn't happen since x is out of scope +outOfScope :: DynFlags -> Namespace -> Wrap RdrName -> ErrMsgM (Doc a) +outOfScope dflags ns x = + case unwrap x of + Unqual occ -> warnAndMonospace (x $> occ) + Qual mdl occ -> pure (DocIdentifierUnchecked (x $> (mdl, occ))) + Orig _ occ -> warnAndMonospace (x $> occ) + Exact name -> warnAndMonospace (x $> name) -- Shouldn't happen since x is out of scope where + prefix = case ns of + Value -> "the value " + Type -> "the type " + None -> "" + warnAndMonospace a = do - tell ["Warning: '" ++ showPpr dflags a ++ "' is out of scope.\n" ++ + let a' = showWrapped (showPpr dflags) a + tell ["Warning: " ++ prefix ++ "'" ++ a' ++ "' is out of scope.\n" ++ " If you qualify the identifier, haddock can try to link it anyway."] - pure (monospaced a) - monospaced a = DocMonospaced (DocString (showPpr dflags a)) + pure (monospaced a') + monospaced = DocMonospaced . DocString -- | Handle ambiguous identifiers. -- @@ -175,26 +195,39 @@ outOfScope dflags x = -- -- Emits a warning if the 'GlobalRdrElts's don't belong to the same type or class. ambiguous :: DynFlags - -> RdrName + -> Wrap NsRdrName -> [GlobalRdrElt] -- ^ More than one @gre@s sharing the same `RdrName` above. -> ErrMsgM (Doc Name) ambiguous dflags x gres = do - let noChildren = map availName (gresToAvailInfo gres) - dflt = maximumBy (comparing (isLocalName &&& isTyConName)) noChildren - msg = "Warning: " ++ x_str ++ " is ambiguous. It is defined\n" ++ - concatMap (\n -> " * " ++ defnLoc n ++ "\n") (map gre_name gres) ++ + let dflt = maximumBy (comparing (gre_lcl &&& isTyConName . gre_name)) gres + msg = "Warning: " ++ showNsRdrName dflags x ++ " is ambiguous. It is defined\n" ++ + concatMap (\n -> " * " ++ defnLoc n ++ "\n") gres ++ " You may be able to disambiguate the identifier by qualifying it or\n" ++ - " by hiding some imports.\n" ++ - " Defaulting to " ++ x_str ++ " defined " ++ defnLoc dflt + " by specifying the type/value namespace explicitly.\n" ++ + " Defaulting to the one defined " ++ defnLoc dflt -- TODO: Once we have a syntax for namespace qualification (#667) we may also -- want to emit a warning when an identifier is a data constructor for a type -- of the same name, but not the only constructor. -- For example, for @data D = C | D@, someone may want to reference the @D@ -- constructor. - when (length noChildren > 1) $ tell [msg] - pure (DocIdentifier dflt) + when (length (gresToAvailInfo gres) > 1) $ tell [msg] + pure (DocIdentifier (x $> gre_name dflt)) + where + defnLoc = showSDoc dflags . pprNameDefnLoc . gre_name + +-- | Handle value-namespaced names that cannot be for values. +-- +-- Emits a warning that the value-namespace is invalid on a non-value identifier. +invalidValue :: DynFlags -> Wrap NsRdrName -> ErrMsgM (Doc a) +invalidValue dflags x = do + tell ["Warning: " ++ showNsRdrName dflags x ++ " cannot be value, yet it is\n" ++ + " namespaced as such. Did you mean to specify a type namespace\n" ++ + " instead?"] + pure (DocMonospaced (DocString (showNsRdrName dflags x))) + +-- | Printable representation of a wrapped and namespaced name +showNsRdrName :: DynFlags -> Wrap NsRdrName -> String +showNsRdrName dflags = (\p i -> p ++ "'" ++ i ++ "'") <$> prefix <*> ident where - isLocalName (nameSrcLoc -> RealSrcLoc {}) = True - isLocalName _ = False - x_str = '\'' : showPpr dflags x ++ "'" - defnLoc = showSDoc dflags . pprNameDefnLoc + ident = showWrapped (showPpr dflags . rdrName) + prefix = renderNs . namespace . unwrap diff --git a/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs b/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs index 050901b6..37813d16 100644 --- a/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs +++ b/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveFunctor #-} {-# OPTIONS_GHC -Wwarn #-} ----------------------------------------------------------------------------- -- | @@ -11,12 +12,12 @@ ----------------------------------------------------------------------------- module Haddock.Interface.ParseModuleHeader (parseModuleHeader) where -import Control.Monad (mplus) +import Control.Applicative (Alternative (..)) +import Control.Monad (ap) import Data.Char import DynFlags import Haddock.Parser import Haddock.Types -import RdrName -- ----------------------------------------------------------------------------- -- Parsing module headers @@ -24,37 +25,47 @@ import RdrName -- NB. The headers must be given in the order Module, Description, -- Copyright, License, Maintainer, Stability, Portability, except that -- any or all may be omitted. -parseModuleHeader :: DynFlags -> Maybe Package -> String -> (HaddockModInfo RdrName, MDoc RdrName) +parseModuleHeader :: DynFlags -> Maybe Package -> String -> (HaddockModInfo NsRdrName, MDoc NsRdrName) parseModuleHeader dflags pkgName str0 = let - getKey :: String -> String -> (Maybe String,String) - getKey key str = case parseKey key str of - Nothing -> (Nothing,str) - Just (value,rest) -> (Just value,rest) - - (_moduleOpt,str1) = getKey "Module" str0 - (descriptionOpt,str2) = getKey "Description" str1 - (copyrightOpt,str3) = getKey "Copyright" str2 - (licenseOpt,str4) = getKey "License" str3 - (licenceOpt,str5) = getKey "Licence" str4 - (spdxLicenceOpt,str6) = getKey "SPDX-License-Identifier" str5 - (maintainerOpt,str7) = getKey "Maintainer" str6 - (stabilityOpt,str8) = getKey "Stability" str7 - (portabilityOpt,str9) = getKey "Portability" str8 + kvs :: [(String, String)] + str1 :: String + + (kvs, str1) = maybe ([], str0) id $ runP fields str0 + + -- trim whitespaces + trim :: String -> String + trim = dropWhile isSpace . reverse . dropWhile isSpace . reverse + + getKey :: String -> Maybe String + getKey key = fmap trim (lookup key kvs) + + descriptionOpt = getKey "Description" + copyrightOpt = getKey "Copyright" + licenseOpt = getKey "License" + licenceOpt = getKey "Licence" + spdxLicenceOpt = getKey "SPDX-License-Identifier" + maintainerOpt = getKey "Maintainer" + stabilityOpt = getKey "Stability" + portabilityOpt = getKey "Portability" in (HaddockModInfo { hmi_description = parseString dflags <$> descriptionOpt, hmi_copyright = copyrightOpt, - hmi_license = spdxLicenceOpt `mplus` licenseOpt `mplus` licenceOpt, + hmi_license = spdxLicenceOpt <|> licenseOpt <|> licenceOpt, hmi_maintainer = maintainerOpt, hmi_stability = stabilityOpt, hmi_portability = portabilityOpt, hmi_safety = Nothing, hmi_language = Nothing, -- set in LexParseRn hmi_extensions = [] -- also set in LexParseRn - }, parseParas dflags pkgName str9) + }, parseParas dflags pkgName str1) --- | This function is how we read keys. +------------------------------------------------------------------------------- +-- Small parser to parse module header. +------------------------------------------------------------------------------- + +-- | The below is a small parser framework how we read keys. -- -- all fields in the header are optional and have the form -- @@ -73,78 +84,105 @@ parseModuleHeader dflags pkgName str0 = -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". -parseKey :: String -> String -> Maybe (String,String) -parseKey key toParse0 = - do - let - (spaces0,toParse1) = extractLeadingSpaces (dropWhile (`elem` ['\r', '\n']) toParse0) - - indentation = spaces0 - afterKey0 <- extractPrefix key toParse1 - let - afterKey1 = extractLeadingSpaces afterKey0 - afterColon0 <- case snd afterKey1 of - ':':afterColon -> return afterColon - _ -> Nothing - let - (_,afterColon1) = extractLeadingSpaces afterColon0 - - return (scanKey True indentation afterColon1) - where - scanKey :: Bool -> String -> String -> (String,String) - scanKey _ _ [] = ([],[]) - scanKey isFirst indentation str = - let - (nextLine,rest1) = extractNextLine str - - accept = isFirst || sufficientIndentation || allSpaces - - sufficientIndentation = case extractPrefix indentation nextLine of - Just (c:_) | isSpace c -> True - _ -> False - - allSpaces = case extractLeadingSpaces nextLine of - (_,[]) -> True - _ -> False - in - if accept - then - let - (scanned1,rest2) = scanKey False indentation rest1 - - scanned2 = case scanned1 of - "" -> if allSpaces then "" else nextLine - _ -> nextLine ++ "\n" ++ scanned1 - in - (scanned2,rest2) - else - ([],str) - - extractLeadingSpaces :: String -> (String,String) - extractLeadingSpaces [] = ([],[]) - extractLeadingSpaces (s@(c:cs)) - | isSpace c = - let - (spaces1,cs1) = extractLeadingSpaces cs - in - (c:spaces1,cs1) - | otherwise = ([],s) - - extractNextLine :: String -> (String,String) - extractNextLine [] = ([],[]) - extractNextLine (c:cs) - | c == '\n' = - ([],cs) - | otherwise = - let - (line,rest) = extractNextLine cs - in - (c:line,rest) - - -- comparison is case-insensitive. - extractPrefix :: String -> String -> Maybe String - extractPrefix [] s = Just s - extractPrefix _ [] = Nothing - extractPrefix (c1:cs1) (c2:cs2) - | toUpper c1 == toUpper c2 = extractPrefix cs1 cs2 - | otherwise = Nothing + +-- | 'C' is a 'Char' carrying its column. +-- +-- This let us make an indentation-aware parser, as we know current indentation. +-- by looking at the next character in the stream ('curInd'). +-- +-- Thus we can munch all spaces but only not-spaces which are indented. +-- +data C = C {-# UNPACK #-} !Int Char + +newtype P a = P { unP :: [C] -> Maybe ([C], a) } + deriving Functor + +instance Applicative P where + pure x = P $ \s -> Just (s, x) + (<*>) = ap + +instance Monad P where + return = pure + m >>= k = P $ \s0 -> do + (s1, x) <- unP m s0 + unP (k x) s1 + +instance Alternative P where + empty = P $ \_ -> Nothing + a <|> b = P $ \s -> unP a s <|> unP b s + +runP :: P a -> String -> Maybe a +runP p input = fmap snd (unP p input') + where + input' = concat + [ zipWith C [0..] l ++ [C (length l) '\n'] + | l <- lines input + ] + +------------------------------------------------------------------------------- +-- +------------------------------------------------------------------------------- + +curInd :: P Int +curInd = P $ \s -> Just . (,) s $ case s of + [] -> 0 + C i _ : _ -> i + +rest :: P String +rest = P $ \cs -> Just ([], [ c | C _ c <- cs ]) + +munch :: (Int -> Char -> Bool) -> P String +munch p = P $ \cs -> + let (xs,ys) = takeWhileMaybe p' cs in Just (ys, xs) + where + p' (C i c) + | p i c = Just c + | otherwise = Nothing + +munch1 :: (Int -> Char -> Bool) -> P String +munch1 p = P $ \s -> case s of + [] -> Nothing + (c:cs) | Just c' <- p' c -> let (xs,ys) = takeWhileMaybe p' cs in Just (ys, c' : xs) + | otherwise -> Nothing + where + p' (C i c) + | p i c = Just c + | otherwise = Nothing + +char :: Char -> P Char +char c = P $ \s -> case s of + [] -> Nothing + (C _ c' : cs) | c == c' -> Just (cs, c) + | otherwise -> Nothing + +skipSpaces :: P () +skipSpaces = P $ \cs -> Just (dropWhile (\(C _ c) -> isSpace c) cs, ()) + +takeWhileMaybe :: (a -> Maybe b) -> [a] -> ([b], [a]) +takeWhileMaybe f = go where + go xs0@[] = ([], xs0) + go xs0@(x:xs) = case f x of + Just y -> let (ys, zs) = go xs in (y : ys, zs) + Nothing -> ([], xs0) + +------------------------------------------------------------------------------- +-- Fields +------------------------------------------------------------------------------- + +field :: Int -> P (String, String) +field i = do + fn <- munch1 $ \_ c -> isAlpha c || c == '-' + skipSpaces + _ <- char ':' + skipSpaces + val <- munch $ \j c -> isSpace c || j > i + return (fn, val) + +fields :: P ([(String, String)], String) +fields = do + skipSpaces + i <- curInd + fs <- many (field i) + r <- rest + return (fs, r) + diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 5b96c0a0..72d063dc 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -173,8 +173,8 @@ renameLDocHsSyn :: LHsDocString -> RnM LHsDocString renameLDocHsSyn = return -renameDoc :: Traversable t => t Name -> RnM (t DocName) -renameDoc = traverse rename +renameDoc :: Traversable t => t (Wrap Name) -> RnM (t (Wrap DocName)) +renameDoc = traverse (traverse rename) renameFnArgsDoc :: FnArgsDoc Name -> RnM (FnArgsDoc DocName) renameFnArgsDoc = mapM renameDoc diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs index 36729d70..b5be311a 100644 --- a/haddock-api/src/Haddock/InterfaceFile.hs +++ b/haddock-api/src/Haddock/InterfaceFile.hs @@ -83,7 +83,7 @@ binaryInterfaceMagic = 0xD0Cface -- binaryInterfaceVersion :: Word16 #if (__GLASGOW_HASKELL__ >= 809) && (__GLASGOW_HASKELL__ < 811) -binaryInterfaceVersion = 34 +binaryInterfaceVersion = 35 binaryInterfaceVersionCompatibility :: [Word16] binaryInterfaceVersionCompatibility = [binaryInterfaceVersion] @@ -701,3 +701,28 @@ instance Binary DocName where name <- get bh return (Undocumented name) _ -> error "get DocName: Bad h" + +instance Binary n => Binary (Wrap n) where + put_ bh (Unadorned n) = do + putByte bh 0 + put_ bh n + put_ bh (Parenthesized n) = do + putByte bh 1 + put_ bh n + put_ bh (Backticked n) = do + putByte bh 2 + put_ bh n + + get bh = do + h <- getByte bh + case h of + 0 -> do + name <- get bh + return (Unadorned name) + 1 -> do + name <- get bh + return (Parenthesized name) + 2 -> do + name <- get bh + return (Backticked name) + _ -> error "get Wrap: Bad h" diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index e314bbd0..510810b0 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -43,7 +43,6 @@ module Haddock.Options ( import qualified Data.Char as Char import Data.Version import Control.Applicative -import Distribution.Verbosity import FastString import GHC ( DynFlags, Module, moduleUnitId ) import Haddock.Types @@ -332,7 +331,7 @@ sinceQualification flags = verbosity :: [Flag] -> Verbosity verbosity flags = case [ str | Flag_Verbosity str <- flags ] of - [] -> normal + [] -> Normal x:_ -> case parseVerbosity x of Left e -> throwE e Right v -> v diff --git a/haddock-api/src/Haddock/Parser.hs b/haddock-api/src/Haddock/Parser.hs index e31ea6a8..6d5dc103 100644 --- a/haddock-api/src/Haddock/Parser.hs +++ b/haddock-api/src/Haddock/Parser.hs @@ -15,26 +15,32 @@ module Haddock.Parser ( parseParas import qualified Documentation.Haddock.Parser as P import Documentation.Haddock.Types +import Haddock.Types import DynFlags ( DynFlags ) import FastString ( fsLit ) import Lexer ( mkPState, unP, ParseResult(POk) ) import Parser ( parseIdentifier ) -import RdrName ( RdrName ) -import SrcLoc ( mkRealSrcLoc, unLoc ) +import SrcLoc ( mkRealSrcLoc, GenLocated(..) ) import StringBuffer ( stringToStringBuffer ) -parseParas :: DynFlags -> Maybe Package -> String -> MetaDoc mod RdrName + +parseParas :: DynFlags -> Maybe Package -> String -> MetaDoc mod (Wrap NsRdrName) parseParas d p = overDoc (P.overIdentifier (parseIdent d)) . P.parseParas p -parseString :: DynFlags -> String -> DocH mod RdrName +parseString :: DynFlags -> String -> DocH mod (Wrap NsRdrName) parseString d = P.overIdentifier (parseIdent d) . P.parseString -parseIdent :: DynFlags -> String -> Maybe RdrName -parseIdent dflags str0 = - let buffer = stringToStringBuffer str0 +parseIdent :: DynFlags -> Namespace -> String -> Maybe (Wrap NsRdrName) +parseIdent dflags ns str0 = + let buffer = stringToStringBuffer str1 realSrcLc = mkRealSrcLoc (fsLit "<unknown file>") 0 0 pstate = mkPState dflags buffer realSrcLc + (wrap,str1) = case str0 of + '(' : s@(c : _) | c /= ',', c /= ')' -- rule out tuple names + -> (Parenthesized, init s) + '`' : s@(_ : _) -> (Backticked, init s) + _ -> (Unadorned, str0) in case unP parseIdentifier pstate of - POk _ name -> Just (unLoc name) + POk _ (L _ name) -> Just (wrap (NsRdrName ns name)) _ -> Nothing diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index b5659038..28e3caed 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -42,7 +42,7 @@ import GHC import DynFlags (Language) import qualified GHC.LanguageExtensions as LangExt import OccName -import Outputable +import Outputable hiding ((<>)) ----------------------------------------------------------------------------- -- * Convenient synonyms @@ -284,6 +284,12 @@ noDocForDecl = (Documentation Nothing Nothing, mempty) -- | Type of environment used to cross-reference identifiers in the syntax. type LinkEnv = Map Name Module +-- | An 'RdrName' tagged with some type/value namespace information. +data NsRdrName = NsRdrName + { namespace :: !Namespace + , rdrName :: !RdrName + } + -- | Extends 'Name' with cross-reference information. data DocName = Documented Name Module @@ -328,7 +334,30 @@ instance SetName DocName where setName name' (Documented _ mdl) = Documented name' mdl setName name' (Undocumented _) = Undocumented name' +-- | Adds extra "wrapper" information to a name. +-- +-- This is to work around the fact that most name types in GHC ('Name', 'RdrName', +-- 'OccName', ...) don't include backticks or parens. +data Wrap n + = Unadorned { unwrap :: n } -- ^ don't do anything to the name + | Parenthesized { unwrap :: n } -- ^ add parentheses around the name + | Backticked { unwrap :: n } -- ^ add backticks around the name + deriving (Show, Functor, Foldable, Traversable) + +-- | Useful for debugging +instance Outputable n => Outputable (Wrap n) where + ppr (Unadorned n) = ppr n + ppr (Parenthesized n) = hcat [ char '(', ppr n, char ')' ] + ppr (Backticked n) = hcat [ char '`', ppr n, char '`' ] + +showWrapped :: (a -> String) -> Wrap a -> String +showWrapped f (Unadorned n) = f n +showWrapped f (Parenthesized n) = "(" ++ f n ++ ")" +showWrapped f (Backticked n) = "`" ++ f n ++ "`" + +instance HasOccName DocName where + occName = occName . getName ----------------------------------------------------------------------------- -- * Instances @@ -423,10 +452,10 @@ instance NamedThing name => NamedThing (InstOrigin name) where type LDoc id = Located (Doc id) -type Doc id = DocH (ModuleName, OccName) id -type MDoc id = MetaDoc (ModuleName, OccName) id +type Doc id = DocH (Wrap (ModuleName, OccName)) (Wrap id) +type MDoc id = MetaDoc (Wrap (ModuleName, OccName)) (Wrap id) -type DocMarkup id a = DocMarkupH (ModuleName, OccName) id a +type DocMarkup id a = DocMarkupH (Wrap (ModuleName, OccName)) id a instance (NFData a, NFData mod) => NFData (DocH mod a) where diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs index d817e4fa..79673365 100644 --- a/haddock-api/src/Haddock/Utils.hs +++ b/haddock-api/src/Haddock/Utils.hs @@ -49,7 +49,7 @@ module Haddock.Utils ( MonadIO(..), -- * Logging - parseVerbosity, + parseVerbosity, Verbosity(..), silent, normal, verbose, deafening, out, -- * System tools @@ -81,8 +81,6 @@ import System.Directory ( createDirectory, removeDirectoryRecursive ) import System.IO ( hPutStr, hSetEncoding, IOMode(..), stderr, utf8, withFile ) import System.IO.Unsafe ( unsafePerformIO ) import qualified System.FilePath.Posix as HtmlPath -import Distribution.Verbosity -import Distribution.ReadE #ifndef mingw32_HOST_OS import qualified System.Posix.Internals @@ -95,10 +93,27 @@ import MonadUtils ( MonadIO(..) ) -- * Logging -------------------------------------------------------------------------------- +data Verbosity = Silent | Normal | Verbose | Deafening + deriving (Eq, Ord, Enum, Bounded, Show) -parseVerbosity :: String -> Either String Verbosity -parseVerbosity = runReadE flagToVerbosity +silent, normal, verbose, deafening :: Verbosity +silent = Silent +normal = Normal +verbose = Verbose +deafening = Deafening +-- | Parse out a verbosity level. Inspired from Cabal's verbosity parsing. +parseVerbosity :: String -> Either String Verbosity +parseVerbosity "0" = Right Silent +parseVerbosity "1" = Right Normal +parseVerbosity "2" = Right Silent +parseVerbosity "3" = Right Deafening +parseVerbosity "silent" = return Silent +parseVerbosity "normal" = return Normal +parseVerbosity "verbose" = return Verbose +parseVerbosity "debug" = return Deafening +parseVerbosity "deafening" = return Deafening +parseVerbosity other = Left ("Can't parse verbosity " ++ other) -- | Print a message to stdout, if it is not too verbose out :: MonadIO m diff --git a/haddock-library/.ghci b/haddock-library/.ghci deleted file mode 100644 index 78950a5b..00000000 --- a/haddock-library/.ghci +++ /dev/null @@ -1 +0,0 @@ -:set -isrc -ivendor/attoparsec-0.12.1.1 -itest -idist/build -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h diff --git a/haddock-library/CHANGES.md b/haddock-library/CHANGES.md index 265579ca..d112db45 100644 --- a/haddock-library/CHANGES.md +++ b/haddock-library/CHANGES.md @@ -1,3 +1,7 @@ +## Changes in version 1.8.0.1 + + * Fix build-time regression for `base < 4.7` (#1119) + ## Changes in version 1.8.0 * Support inline markup in markdown-style links (#875) diff --git a/haddock-library/fixtures/examples/list-blocks1.input b/haddock-library/fixtures/examples/list-blocks1.input new file mode 100644 index 00000000..72a0640b --- /dev/null +++ b/haddock-library/fixtures/examples/list-blocks1.input @@ -0,0 +1,15 @@ +* Something about foo + + @ + foo :: a -> b -> c + foo a b = bar c b + @ + +* Something about bar + + @ + bar :: a -> b -> c + bar a b = foo b a + @ + +* And then we continue diff --git a/haddock-library/fixtures/examples/list-blocks1.parsed b/haddock-library/fixtures/examples/list-blocks1.parsed new file mode 100644 index 00000000..9fc4f0ba --- /dev/null +++ b/haddock-library/fixtures/examples/list-blocks1.parsed @@ -0,0 +1,12 @@ +DocUnorderedList + [DocAppend + (DocParagraph (DocString "Something about foo")) + (DocCodeBlock + (DocString + (concat ["foo :: a -> b -> c\n", "foo a b = bar c b\n"]))), + DocAppend + (DocParagraph (DocString "Something about bar")) + (DocCodeBlock + (DocString + (concat ["bar :: a -> b -> c\n", "bar a b = foo b a\n"]))), + DocParagraph (DocString "And then we continue")] diff --git a/haddock-library/fixtures/examples/list-blocks2.input b/haddock-library/fixtures/examples/list-blocks2.input new file mode 100644 index 00000000..91492adb --- /dev/null +++ b/haddock-library/fixtures/examples/list-blocks2.input @@ -0,0 +1,10 @@ +=== Title + +* List directly +* after the title + + @ + with some inline things + @ + +* is parsed weirdly diff --git a/haddock-library/fixtures/examples/list-blocks2.parsed b/haddock-library/fixtures/examples/list-blocks2.parsed new file mode 100644 index 00000000..169677b7 --- /dev/null +++ b/haddock-library/fixtures/examples/list-blocks2.parsed @@ -0,0 +1,10 @@ +DocAppend + (DocAppend + (DocHeader + Header {headerLevel = 3, headerTitle = DocString "Title"}) + (DocUnorderedList + [DocParagraph (DocString "List directly"), + DocAppend + (DocParagraph (DocString "after the title")) + (DocCodeBlock (DocString "with some inline things\n"))])) + (DocUnorderedList [DocParagraph (DocString "is parsed weirdly")]) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index b24db5d4..e58fe2ef 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: haddock-library -version: 1.8.0 +version: 1.8.0.1 synopsis: Library exposing some functionality of Haddock. description: Haddock is a documentation-generation tool for Haskell @@ -19,12 +19,14 @@ bug-reports: https://github.com/haskell/haddock/issues category: Documentation extra-source-files: CHANGES.md + fixtures/examples/*.input + fixtures/examples/*.parsed common lib-defaults default-language: Haskell2010 build-depends: - , base >= 4.5 && < 4.14 + , base >= 4.5 && < 4.15 , bytestring ^>= 0.9.2.1 || ^>= 0.10.0.0 , containers ^>= 0.4.2.1 || ^>= 0.5.0.0 || ^>= 0.6.0.1 , transformers ^>= 0.3.0.0 || ^>= 0.4.1.0 || ^>= 0.5.0.0 @@ -33,7 +35,7 @@ common lib-defaults ghc-options: -funbox-strict-fields -Wall -fwarn-tabs if impl(ghc >= 8.0) - ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances + ghc-options: -Wcompat -Wnoncanonical-monad-instances library import: lib-defaults @@ -47,8 +49,10 @@ library Documentation.Haddock.Types other-modules: + CompatPrelude Documentation.Haddock.Parser.Util Documentation.Haddock.Parser.Monad + Documentation.Haddock.Parser.Identifier test-suite spec import: lib-defaults @@ -70,10 +74,11 @@ test-suite spec Documentation.Haddock.Parser.UtilSpec Documentation.Haddock.ParserSpec Documentation.Haddock.Types + Documentation.Haddock.Parser.Identifier build-depends: - , base-compat ^>= 0.9.3 || ^>= 0.10.0 - , QuickCheck ^>= 2.11.3 + , base-compat ^>= 0.9.3 || ^>= 0.11.0 + , QuickCheck ^>= 2.11 || ^>= 2.13.2 , deepseq ^>= 1.3.0.0 || ^>= 1.4.0.0 -- NB: build-depends & build-tool-depends have independent @@ -81,10 +86,10 @@ test-suite spec -- version of `hspec` & `hspec-discover` to ensure -- intercompatibility build-depends: - , hspec ^>= 2.5.5 + , hspec >= 2.4.4 && < 2.8 build-tool-depends: - , hspec-discover:hspec-discover ^>= 2.5.5 + , hspec-discover:hspec-discover >= 2.4.4 && < 2.8 test-suite fixtures type: exitcode-stdio-1.0 @@ -92,7 +97,6 @@ test-suite fixtures main-is: Fixtures.hs ghc-options: -Wall hs-source-dirs: fixtures - buildable: False build-depends: -- intra-package dependency , haddock-library @@ -100,11 +104,11 @@ test-suite fixtures , base -- extra dependencies - , base-compat >= 0.9.3 && < 0.11 + , base-compat ^>= 0.9.3 || ^>= 0.11.0 , directory ^>= 1.3.0.2 , filepath ^>= 1.4.1.2 - , optparse-applicative ^>= 0.14.0.0 - , tree-diff ^>= 0.0.0.1 + , optparse-applicative ^>= 0.15 + , tree-diff ^>= 0.1 source-repository head type: git diff --git a/haddock-library/src/CompatPrelude.hs b/haddock-library/src/CompatPrelude.hs new file mode 100644 index 00000000..60fa94d9 --- /dev/null +++ b/haddock-library/src/CompatPrelude.hs @@ -0,0 +1,52 @@ +{-# LANGUAGE CPP #-} + +#if !MIN_VERSION_base(4,5,0) +# error This module doesn't provide compat-shims for versions prior to base-4.5 +#endif + +-- | Bridge impedance mismatch of different @base@ versions back till @base-4.5@ (GHC 7.4.2) +module CompatPrelude + ( ($>) + , isSymbolChar + ) where + +#if MIN_VERSION_base(4,7,0) +import Data.Functor ( ($>) ) +#else +import Data.Functor ( (<$) ) +#endif + +#if MIN_VERSION_base(4,9,0) +import Text.Read.Lex (isSymbolChar) +#else +import Data.Char (GeneralCategory(..), generalCategory) +#endif + + +#if !MIN_VERSION_base(4,7,0) +infixl 4 $> + +-- | Flipped version of '<$'. +-- +-- @since 4.7.0.0 +($>) :: Functor f => f a -> b -> f b +($>) = flip (<$) +#endif + +#if !MIN_VERSION_base(4,9,0) +-- inlined from base-4.10.0.0 +isSymbolChar :: Char -> Bool +isSymbolChar c = not (isPuncChar c) && case generalCategory c of + MathSymbol -> True + CurrencySymbol -> True + ModifierSymbol -> True + OtherSymbol -> True + DashPunctuation -> True + OtherPunctuation -> c `notElem` "'\"" + ConnectorPunctuation -> c /= '_' + _ -> False + where + -- | The @special@ character class as defined in the Haskell Report. + isPuncChar :: Char -> Bool + isPuncChar = (`elem` (",;()[]{}`" :: String)) +#endif diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 82d65a0a..028422a7 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} -- | @@ -27,7 +26,7 @@ module Documentation.Haddock.Parser ( import Control.Applicative import Control.Arrow (first) import Control.Monad -import Data.Char (chr, isUpper, isAlpha, isAlphaNum, isSpace) +import Data.Char (chr, isUpper, isAlpha, isSpace) import Data.List (intercalate, unfoldr, elemIndex) import Data.Maybe (fromMaybe, mapMaybe) import Data.Monoid @@ -36,6 +35,7 @@ import Documentation.Haddock.Doc import Documentation.Haddock.Markup ( markup, plainMarkup ) import Documentation.Haddock.Parser.Monad import Documentation.Haddock.Parser.Util +import Documentation.Haddock.Parser.Identifier import Documentation.Haddock.Types import Prelude hiding (takeWhile) import qualified Prelude as P @@ -46,53 +46,26 @@ import Text.Parsec (try) import qualified Data.Text as T import Data.Text (Text) -#if MIN_VERSION_base(4,9,0) -import Text.Read.Lex (isSymbolChar) -#else -import Data.Char (GeneralCategory (..), - generalCategory) -#endif -- $setup -- >>> :set -XOverloadedStrings -#if !MIN_VERSION_base(4,9,0) --- inlined from base-4.10.0.0 -isSymbolChar :: Char -> Bool -isSymbolChar c = not (isPuncChar c) && case generalCategory c of - MathSymbol -> True - CurrencySymbol -> True - ModifierSymbol -> True - OtherSymbol -> True - DashPunctuation -> True - OtherPunctuation -> c `notElem` ("'\"" :: String) - ConnectorPunctuation -> c /= '_' - _ -> False - where - -- | The @special@ character class as defined in the Haskell Report. - isPuncChar :: Char -> Bool - isPuncChar = (`elem` (",;()[]{}`" :: String)) -#endif - --- | Identifier string surrounded with opening and closing quotes/backticks. -type Identifier = (Char, String, Char) - -- | Drops the quotes/backticks around all identifiers, as if they -- were valid but still 'String's. toRegular :: DocH mod Identifier -> DocH mod String -toRegular = fmap (\(_, x, _) -> x) +toRegular = fmap (\(Identifier _ _ x _) -> x) -- | Maps over 'DocIdentifier's over 'String' with potentially failing -- conversion using user-supplied function. If the conversion fails, -- the identifier is deemed to not be valid and is treated as a -- regular string. -overIdentifier :: (String -> Maybe a) +overIdentifier :: (Namespace -> String -> Maybe a) -> DocH mod Identifier -> DocH mod a overIdentifier f d = g d where - g (DocIdentifier (o, x, e)) = case f x of - Nothing -> DocString $ o : x ++ [e] + g (DocIdentifier (Identifier ns o x e)) = case f ns x of + Nothing -> DocString $ renderNs ns ++ [o] ++ x ++ [e] Just x' -> DocIdentifier x' g DocEmpty = DocEmpty g (DocAppend x x') = DocAppend (g x) (g x') @@ -314,7 +287,8 @@ markdownImage :: Parser (DocH mod Identifier) markdownImage = DocPic . fromHyperlink <$> ("!" *> linkParser) where fromHyperlink (Hyperlink u l) = Picture u (fmap (markup stringMarkup) l) - stringMarkup = plainMarkup (const "") (\(l,c,r) -> [l] <> c <> [r]) + stringMarkup = plainMarkup (const "") renderIdent + renderIdent (Identifier ns l c r) = renderNs ns <> [l] <> c <> [r] -- | Paragraph parser, called by 'parseParas'. paragraph :: Parser (DocH mod Identifier) @@ -836,30 +810,6 @@ autoUrl = mkLink <$> url mkHyperlink lnk = Hyperlink (T.unpack lnk) Nothing - --- | Parses strings between identifier delimiters. Consumes all input that it --- deems to be valid in an identifier. Note that it simply blindly consumes --- characters and does no actual validation itself. -parseValid :: Parser String -parseValid = p some - where - idChar = Parsec.satisfy (\c -> isAlphaNum c || isSymbolChar c || c == '_') - - p p' = do - vs <- p' idChar - c <- peekChar' - case c of - '`' -> return vs - '\'' -> choice' [ (\x -> vs ++ "'" ++ x) <$> ("'" *> p many), return vs ] - _ -> fail "outofvalid" - --- | Parses identifiers with help of 'parseValid'. Asks GHC for --- 'String' from the string it deems valid. +-- | Parses identifiers with help of 'parseValid'. identifier :: Parser (DocH mod Identifier) -identifier = do - o <- idDelim - vid <- parseValid - e <- idDelim - return $ DocIdentifier (o, vid, e) - where - idDelim = Parsec.satisfy (\c -> c == '\'' || c == '`') +identifier = DocIdentifier <$> parseValid diff --git a/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs b/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs new file mode 100644 index 00000000..b8afb951 --- /dev/null +++ b/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs @@ -0,0 +1,160 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE ViewPatterns #-} +-- | +-- Module : Documentation.Haddock.Parser.Identifier +-- Copyright : (c) Alec Theriault 2019, +-- License : BSD-like +-- +-- Maintainer : haddock@projects.haskell.org +-- Stability : experimental +-- Portability : portable +-- +-- Functionality for parsing identifiers and operators + +module Documentation.Haddock.Parser.Identifier ( + Identifier(..), + parseValid, +) where + +import Documentation.Haddock.Types ( Namespace(..) ) +import Documentation.Haddock.Parser.Monad +import qualified Text.Parsec as Parsec +import Text.Parsec.Pos ( updatePosChar ) +import Text.Parsec ( State(..) + , getParserState, setParserState ) + +import Data.Text (Text) +import qualified Data.Text as T + +import Data.Char (isAlpha, isAlphaNum) +import Control.Monad (guard) +import Data.Maybe +import CompatPrelude + +-- | Identifier string surrounded with namespace, opening, and closing quotes/backticks. +data Identifier = Identifier !Namespace !Char String !Char + deriving (Show, Eq) + +parseValid :: Parser Identifier +parseValid = do + s@State{ stateInput = inp, statePos = pos } <- getParserState + + case takeIdentifier inp of + Nothing -> Parsec.parserFail "parseValid: Failed to match a valid identifier" + Just (ns, op, ident, cl, inp') -> + let posOp = updatePosChar pos op + posIdent = T.foldl updatePosChar posOp ident + posCl = updatePosChar posIdent cl + s' = s{ stateInput = inp', statePos = posCl } + in setParserState s' $> Identifier ns op (T.unpack ident) cl + + +-- | Try to parse a delimited identifier off the front of the given input. +-- +-- This tries to match as many valid Haskell identifiers/operators as possible, +-- to the point of sometimes accepting invalid things (ex: keywords). Some +-- considerations: +-- +-- - operators and identifiers can have module qualifications +-- - operators can be wrapped in parens (for prefix) +-- - identifiers can be wrapped in backticks (for infix) +-- - delimiters are backticks or regular ticks +-- - since regular ticks are also valid in identifiers, we opt for the +-- longest successful parse +-- +-- This function should make /O(1)/ allocations +takeIdentifier :: Text -> Maybe (Namespace, Char, Text, Char, Text) +takeIdentifier input = listToMaybe $ do + + -- Optional namespace + let (ns, input') = case T.uncons input of + Just ('v', i) -> (Value, i) + Just ('t', i) -> (Type, i) + _ -> (None, input) + + -- Opening tick + (op, input'') <- maybeToList (T.uncons input') + guard (op == '\'' || op == '`') + + -- Identifier/operator + (ident, input''') <- wrapped input'' + + -- Closing tick + (cl, input'''') <- maybeToList (T.uncons input''') + guard (cl == '\'' || cl == '`') + + return (ns, op, ident, cl, input'''') + + where + + -- | Parse out a wrapped, possibly qualified, operator or identifier + wrapped t = do + (c, t' ) <- maybeToList (T.uncons t) + -- Tuples + case c of + '(' | Just (c', _) <- T.uncons t' + , c' == ',' || c' == ')' + -> do let (commas, t'') = T.span (== ',') t' + (')', t''') <- maybeToList (T.uncons t'') + return (T.take (T.length commas + 2) t, t''') + + -- Parenthesized + '(' -> do (n, t'' ) <- general False 0 [] t' + (')', t''') <- maybeToList (T.uncons t'') + return (T.take (n + 2) t, t''') + + -- Backticked + '`' -> do (n, t'' ) <- general False 0 [] t' + ('`', t''') <- maybeToList (T.uncons t'') + return (T.take (n + 2) t, t''') + + -- Unadorned + _ -> do (n, t'' ) <- general False 0 [] t + return (T.take n t, t'') + + -- | Parse out a possibly qualified operator or identifier + general :: Bool -- ^ refuse inputs starting with operators + -> Int -- ^ total characters \"consumed\" so far + -> [(Int, Text)] -- ^ accumulated results + -> Text -- ^ current input + -> [(Int, Text)] -- ^ total characters parsed & what remains + general !identOnly !i acc t + -- Starts with an identifier (either just an identifier, or a module qual) + | Just (n, rest) <- identLike t + = if T.null rest + then acc + else case T.head rest of + '`' -> (n + i, rest) : acc + ')' -> (n + i, rest) : acc + '.' -> general False (n + i + 1) acc (T.tail rest) + '\'' -> let (m, rest') = quotes rest + in general True (n + m + 1 + i) ((n + m + i, rest') : acc) (T.tail rest') + _ -> acc + + -- An operator + | Just (n, rest) <- optr t + , not identOnly + = (n + i, rest) : acc + + -- Anything else + | otherwise + = acc + + -- | Parse an identifier off the front of the input + identLike t + | T.null t = Nothing + | isAlpha (T.head t) || '_' == T.head t + = let !(idt, rest) = T.span (\c -> isAlphaNum c || c == '_') t + !(octos, rest') = T.span (== '#') rest + in Just (T.length idt + T.length octos, rest') + | otherwise = Nothing + + -- | Parse all but the last quote off the front of the input + -- PRECONDITION: T.head t == '\'' + quotes :: Text -> (Int, Text) + quotes t = let !n = T.length (T.takeWhile (== '\'') t) - 1 + in (n, T.drop n t) + + -- | Parse an operator off the front of the input + optr t = let !(op, rest) = T.span isSymbolChar t + in if T.null op then Nothing else Just (T.length op, rest) diff --git a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs index 8f5bd217..7c73a168 100644 --- a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs +++ b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs @@ -4,6 +4,18 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeSynonymInstances #-} +-- | +-- Module : Documentation.Haddock.Parser.Monad +-- Copyright : (c) Alec Theriault 2018-2019, +-- License : BSD-like +-- +-- Maintainer : haddock@projects.haskell.org +-- Stability : experimental +-- Portability : portable +-- +-- Defines the Parsec monad over which all parsing is done and also provides +-- more efficient versions of the usual parsec combinator functions (but +-- specialized to 'Text'). module Documentation.Haddock.Parser.Monad where @@ -17,7 +29,6 @@ import qualified Data.Text as T import Data.Text ( Text ) import Control.Monad ( mfilter ) -import Data.Functor ( ($>) ) import Data.String ( IsString(..) ) import Data.Bits ( Bits(..) ) import Data.Char ( ord ) @@ -25,7 +36,9 @@ import Data.List ( foldl' ) import Control.Applicative as App import Documentation.Haddock.Types ( Version ) + import Prelude hiding (takeWhile) +import CompatPrelude -- | The only bit of information we really care about truding along with us -- through parsing is the version attached to a @\@since@ annotation - if @@ -96,7 +109,6 @@ takeWhile f = do s' = s{ stateInput = inp', statePos = pos' } setParserState s' $> t - -- | Like 'takeWhile', but fails if no characters matched. -- -- Equivalent to @fmap T.pack . Parsec.many1@, but more efficient. diff --git a/haddock-library/src/Documentation/Haddock/Types.hs b/haddock-library/src/Documentation/Haddock/Types.hs index f8f7d353..4cf61fee 100644 --- a/haddock-library/src/Documentation/Haddock/Types.hs +++ b/haddock-library/src/Documentation/Haddock/Types.hs @@ -44,14 +44,17 @@ data MetaDoc mod id = } deriving (Eq, Show, Functor, Foldable, Traversable) #if MIN_VERSION_base(4,8,0) +-- | __NOTE__: Only defined for @base >= 4.8.0@ instance Bifunctor MetaDoc where bimap f g (MetaDoc m d) = MetaDoc m (bimap f g d) #endif #if MIN_VERSION_base(4,10,0) +-- | __NOTE__: Only defined for @base >= 4.10.0@ instance Bifoldable MetaDoc where bifoldr f g z d = bifoldr f g z (_doc d) +-- | __NOTE__: Only defined for @base >= 4.10.0@ instance Bitraversable MetaDoc where bitraverse f g (MetaDoc m d) = MetaDoc m <$> bitraverse f g d #endif @@ -131,6 +134,7 @@ data DocH mod id deriving (Eq, Show, Functor, Foldable, Traversable) #if MIN_VERSION_base(4,8,0) +-- | __NOTE__: Only defined for @base >= 4.8.0@ instance Bifunctor DocH where bimap _ _ DocEmpty = DocEmpty bimap f g (DocAppend docA docB) = DocAppend (bimap f g docA) (bimap f g docB) @@ -159,6 +163,7 @@ instance Bifunctor DocH where #endif #if MIN_VERSION_base(4,10,0) +-- | __NOTE__: Only defined for @base >= 4.10.0@ instance Bifoldable DocH where bifoldr f g z (DocAppend docA docB) = bifoldr f g (bifoldr f g z docA) docB bifoldr f g z (DocParagraph doc) = bifoldr f g z doc @@ -176,6 +181,7 @@ instance Bifoldable DocH where bifoldr f g z (DocTable (Table header body)) = foldr (\r acc -> foldr (flip (bifoldr f g)) acc r) (foldr (\r acc -> foldr (flip (bifoldr f g)) acc r) z body) header bifoldr _ _ z _ = z +-- | __NOTE__: Only defined for @base >= 4.10.0@ instance Bitraversable DocH where bitraverse _ _ DocEmpty = pure DocEmpty bitraverse f g (DocAppend docA docB) = DocAppend <$> bitraverse f g docA <*> bitraverse f g docB @@ -203,6 +209,16 @@ instance Bitraversable DocH where bitraverse f g (DocTable (Table header body)) = (\h b -> DocTable (Table h b)) <$> traverse (traverse (bitraverse f g)) header <*> traverse (traverse (bitraverse f g)) body #endif +-- | The namespace qualification for an identifier. +data Namespace = Value | Type | None deriving (Eq, Ord, Enum, Show) + +-- | Render the a namespace into the same format it was initially parsed. +renderNs :: Namespace -> String +renderNs Value = "v" +renderNs Type = "t" +renderNs None = "" + + -- | 'DocMarkupH' is a set of instructions for marking up documentation. -- In fact, it's really just a mapping from 'Doc' to some other -- type [a], where [a] is usually the type of the output (HTML, say). diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 6269184a..bc40a0a2 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -112,7 +112,7 @@ spec = do "``" `shouldParseTo` "``" it "can parse an identifier in infix notation enclosed within backticks" $ do - "``infix``" `shouldParseTo` "`" <> DocIdentifier "infix" <> "`" + "``infix``" `shouldParseTo` DocIdentifier "`infix`" it "can parse identifiers containing a single quote" $ do "'don't'" `shouldParseTo` DocIdentifier "don't" @@ -132,6 +132,19 @@ spec = do it "can parse an identifier that starts with an underscore" $ do "'_x'" `shouldParseTo` DocIdentifier "_x" + it "can parse value-namespaced identifiers" $ do + "v'foo'" `shouldParseTo` DocIdentifier "foo" + + it "can parse type-namespaced identifiers" $ do + "t'foo'" `shouldParseTo` DocIdentifier "foo" + + it "can parse parenthesized operators and backticked identifiers" $ do + "'(<|>)'" `shouldParseTo` DocIdentifier "(<|>)" + "'`elem`'" `shouldParseTo` DocIdentifier "`elem`" + + it "can properly figure out the end of identifiers" $ do + "'DbModule'/'DbUnitId'" `shouldParseTo` DocIdentifier "DbModule" <> "/" <> DocIdentifier "DbUnitId" + context "when parsing operators" $ do it "can parse an operator enclosed within single quotes" $ do "'.='" `shouldParseTo` DocIdentifier ".=" diff --git a/haddock-test/haddock-test.cabal b/haddock-test/haddock-test.cabal index a656d707..0dd3eb47 100644 --- a/haddock-test/haddock-test.cabal +++ b/haddock-test/haddock-test.cabal @@ -16,7 +16,7 @@ library default-language: Haskell2010 ghc-options: -Wall hs-source-dirs: src - build-depends: base >= 4.3 && < 4.13, bytestring, directory, process, filepath, Cabal + build-depends: base >= 4.3 && < 4.15, bytestring, directory, process, filepath, Cabal exposed-modules: Test.Haddock diff --git a/haddock.cabal b/haddock.cabal index 0ed722f4..92fe249e 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,6 +1,6 @@ -cabal-version: 2.0 +cabal-version: 2.4 name: haddock -version: 2.22.0 +version: 2.23.0 synopsis: A documentation-generation tool for Haskell libraries description: This is Haddock, a tool for automatically generating documentation @@ -23,8 +23,8 @@ description: without any documentation annotations, Haddock can generate useful documentation from your source code. . - <<https://cdn.rawgit.com/haskell/haddock/ghc-8.6/doc/cheatsheet/haddocks.svg>> -license: BSD2 + <<https://cdn.rawgit.com/haskell/haddock/ghc-8.10/doc/cheatsheet/haddocks.svg>> +license: BSD-3-Clause license-file: LICENSE author: Simon Marlow, David Waern maintainer: Alec Theriault <alec.theriault@gmail.com>, Alex Biehl <alexbiehl@gmail.com>, Simon Hengel <sol@typeful.net>, Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> @@ -33,7 +33,7 @@ bug-reports: https://github.com/haskell/haddock/issues copyright: (c) Simon Marlow, David Waern category: Documentation build-type: Simple -tested-with: GHC==8.6.* +tested-with: GHC==8.10.* extra-source-files: CHANGES.md @@ -46,10 +46,12 @@ extra-source-files: html-test/src/*.hs html-test/ref/*.html hypsrc-test/src/*.hs + hypsrc-test/src/*.h hypsrc-test/ref/src/*.html - latex-test/src/Simple/*.hs - latex-test/ref/Simple/*.tex - latex-test/ref/Simple/*.sty + latex-test/src/**/*.hs + latex-test/ref/**/*.tex + hoogle-test/src/**/*.hs + hoogle-test/ref/**/*.txt flag in-ghc-tree description: Are we in a GHC tree? @@ -64,7 +66,7 @@ executable haddock -- haddock typically only supports a single GHC major version build-depends: - base ^>= 4.13.0.0 + base ^>= 4.14.0.0 if flag(in-ghc-tree) hs-source-dirs: haddock-api/src, haddock-library/src @@ -76,7 +78,6 @@ executable haddock deepseq, array, xhtml >= 3000.2 && < 3000.3, - Cabal >= 1.10, ghc-boot, ghc-boot-th, ghc == 8.10.*, @@ -88,6 +89,7 @@ executable haddock other-modules: Documentation.Haddock.Parser Documentation.Haddock.Parser.Monad + Documentation.Haddock.Parser.Identifier Documentation.Haddock.Types Documentation.Haddock.Doc Documentation.Haddock.Parser.Util @@ -141,7 +143,7 @@ executable haddock else -- in order for haddock's advertised version number to have proper meaning, -- we pin down to a single haddock-api version. - build-depends: haddock-api == 2.22.0 + build-depends: haddock-api == 2.23.0 test-suite html-test type: exitcode-stdio-1.0 diff --git a/hoogle-test/ref/Bug992/test.txt b/hoogle-test/ref/Bug992/test.txt new file mode 100644 index 00000000..8ae145c3 --- /dev/null +++ b/hoogle-test/ref/Bug992/test.txt @@ -0,0 +1,9 @@ +-- Hoogle documentation, generated by Haddock +-- See Hoogle, http://www.haskell.org/hoogle/ + +@package test +@version 0.0.0 + +module Bug992 +data K (m :: * -> *) +K :: K (m :: * -> *) diff --git a/hoogle-test/src/Bug992/Bug992.hs b/hoogle-test/src/Bug992/Bug992.hs new file mode 100644 index 00000000..bd772427 --- /dev/null +++ b/hoogle-test/src/Bug992/Bug992.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE KindSignatures #-} + +module Bug992 where + +data K (m :: * -> *) = K diff --git a/html-test/Main.hs b/html-test/Main.hs index d65a5087..36e56d9a 100755 --- a/html-test/Main.hs +++ b/html-test/Main.hs @@ -45,7 +45,7 @@ stripIfRequired mdl = -- | List of modules in which we don't 'stripLinks' preserveLinksModules :: [String] -preserveLinksModules = ["Bug253"] +preserveLinksModules = ["Bug253.html", "NamespacedIdentifiers.html"] ingoredTests :: [FilePath] ingoredTests = @@ -54,12 +54,6 @@ ingoredTests = -- we need a reliable way to deduplicate here. -- Happens since PR #688. "B" - - -- ignore-exports flag broke with PR #688. We use - -- the Avails calculated by GHC now. Probably - -- requires a change to GHC to "ignore" a modules - -- export list reliably. - , "IgnoreExports" ] checkIgnore :: FilePath -> Bool diff --git a/html-test/ref/A.html b/html-test/ref/A.html index f6b51e69..c27f1888 100644 --- a/html-test/ref/A.html +++ b/html-test/ref/A.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >A</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bold.html b/html-test/ref/Bold.html index 42b51428..2bbe37a4 100644 --- a/html-test/ref/Bold.html +++ b/html-test/ref/Bold.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bold</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug1.html b/html-test/ref/Bug1.html index ed991e24..a14ac387 100644 --- a/html-test/ref/Bug1.html +++ b/html-test/ref/Bug1.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug1</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug1004.html b/html-test/ref/Bug1004.html new file mode 100644 index 00000000..b3bc60cc --- /dev/null +++ b/html-test/ref/Bug1004.html @@ -0,0 +1,2076 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Bug1004</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Bug1004</p + ></div + ><div id="synopsis" + ><details id="syn" + ><summary + >Synopsis</summary + ><ul class="details-toggle" data-details-id="syn" + ><li class="src short" + ><span class="keyword" + >data</span + > <a href="#" + >Product</a + > (f :: k -> <a href="#" title="Data.Kind" + >Type</a + >) (g :: k -> <a href="#" title="Data.Kind" + >Type</a + >) (a :: k) = <a href="#" + >Pair</a + > (f a) (g a)</li + ></ul + ></details + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Product" class="def" + >Product</a + > (f :: k -> <a href="#" title="Data.Kind" + >Type</a + >) (g :: k -> <a href="#" title="Data.Kind" + >Type</a + >) (a :: k) <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Lifted product of functors.</p + ></div + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:Pair" class="def" + >Pair</a + > (f a) (g a)</td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Product" + >Instances</h4 + ><details id="i:Product" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Generic1:1" + ></span + > <a href="#" title="GHC.Generics" + >Generic1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g :: k -> <a href="#" title="Data.Kind" + >Type</a + >)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Generic1:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs associated-types" + ><p class="caption" + >Associated Types</p + ><p class="src" + ><span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g) :: k -> <a href="#" title="Data.Kind" + >Type</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >from1</a + > :: <span class="keyword" + >forall</span + > (a :: k0). <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="GHC.Generics" + >Rep1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g) a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >to1</a + > :: <span class="keyword" + >forall</span + > (a :: k0). <a href="#" title="GHC.Generics" + >Rep1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g) a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Monad:2" + ></span + > (<a href="#" title="Control.Monad" + >Monad</a + > f, <a href="#" title="Control.Monad" + >Monad</a + > g) => <a href="#" title="Control.Monad" + >Monad</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Monad:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >(>>=)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> (a -> <a href="#" title="Bug1004" + >Product</a + > f g b) -> <a href="#" title="Bug1004" + >Product</a + > f g b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(>>)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Bug1004" + >Product</a + > f g b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >return</a + > :: a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Functor:3" + ></span + > (<a href="#" title="Data.Functor" + >Functor</a + > f, <a href="#" title="Data.Functor" + >Functor</a + > g) => <a href="#" title="Data.Functor" + >Functor</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Functor:3" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >fmap</a + > :: (a -> b) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(<$)</a + > :: a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:MonadFix:4" + ></span + > (<a href="#" title="Control.Monad.Fix" + >MonadFix</a + > f, <a href="#" title="Control.Monad.Fix" + >MonadFix</a + > g) => <a href="#" title="Control.Monad.Fix" + >MonadFix</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:MonadFix:4" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >mfix</a + > :: (a -> <a href="#" title="Bug1004" + >Product</a + > f g a) -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Applicative:5" + ></span + > (<a href="#" title="Control.Applicative" + >Applicative</a + > f, <a href="#" title="Control.Applicative" + >Applicative</a + > g) => <a href="#" title="Control.Applicative" + >Applicative</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Applicative:5" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >pure</a + > :: a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(<*>)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g (a -> b) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >liftA2</a + > :: (a -> b -> c) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Bug1004" + >Product</a + > f g c <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(*>)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Bug1004" + >Product</a + > f g b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(<*)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Foldable:6" + ></span + > (<a href="#" title="Data.Foldable" + >Foldable</a + > f, <a href="#" title="Data.Foldable" + >Foldable</a + > g) => <a href="#" title="Data.Foldable" + >Foldable</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Foldable:6" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >fold</a + > :: <a href="#" title="Data.Monoid" + >Monoid</a + > m => <a href="#" title="Bug1004" + >Product</a + > f g m -> m <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldMap</a + > :: <a href="#" title="Data.Monoid" + >Monoid</a + > m => (a -> m) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> m <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldMap'</a + > :: <a href="#" title="Data.Monoid" + >Monoid</a + > m => (a -> m) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> m <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldr</a + > :: (a -> b -> b) -> b -> <a href="#" title="Bug1004" + >Product</a + > f g a -> b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldr'</a + > :: (a -> b -> b) -> b -> <a href="#" title="Bug1004" + >Product</a + > f g a -> b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldl</a + > :: (b -> a -> b) -> b -> <a href="#" title="Bug1004" + >Product</a + > f g a -> b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldl'</a + > :: (b -> a -> b) -> b -> <a href="#" title="Bug1004" + >Product</a + > f g a -> b <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldr1</a + > :: (a -> a -> a) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >foldl1</a + > :: (a -> a -> a) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >toList</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> [a] <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >null</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >length</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Int" + >Int</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >elem</a + > :: <a href="#" title="Data.Eq" + >Eq</a + > a => a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >maximum</a + > :: <a href="#" title="Data.Ord" + >Ord</a + > a => <a href="#" title="Bug1004" + >Product</a + > f g a -> a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >minimum</a + > :: <a href="#" title="Data.Ord" + >Ord</a + > a => <a href="#" title="Bug1004" + >Product</a + > f g a -> a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >sum</a + > :: <a href="#" title="Prelude" + >Num</a + > a => <a href="#" title="Bug1004" + >Product</a + > f g a -> a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >product</a + > :: <a href="#" title="Prelude" + >Num</a + > a => <a href="#" title="Bug1004" + >Product</a + > f g a -> a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Traversable:7" + ></span + > (<a href="#" title="Data.Traversable" + >Traversable</a + > f, <a href="#" title="Data.Traversable" + >Traversable</a + > g) => <a href="#" title="Data.Traversable" + >Traversable</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Traversable:7" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >traverse</a + > :: <a href="#" title="Control.Applicative" + >Applicative</a + > f0 => (a -> f0 b) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> f0 (<a href="#" title="Bug1004" + >Product</a + > f g b) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >sequenceA</a + > :: <a href="#" title="Control.Applicative" + >Applicative</a + > f0 => <a href="#" title="Bug1004" + >Product</a + > f g (f0 a) -> f0 (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >mapM</a + > :: <a href="#" title="Control.Monad" + >Monad</a + > m => (a -> m b) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> m (<a href="#" title="Bug1004" + >Product</a + > f g b) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >sequence</a + > :: <a href="#" title="Control.Monad" + >Monad</a + > m => <a href="#" title="Bug1004" + >Product</a + > f g (m a) -> m (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Eq1:8" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Eq1</a + > f, <a href="#" title="Data.Functor.Classes" + >Eq1</a + > g) => <a href="#" title="Data.Functor.Classes" + >Eq1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Eq1:8" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >liftEq</a + > :: (a -> b -> <a href="#" title="Data.Bool" + >Bool</a + >) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Ord1:9" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Ord1</a + > f, <a href="#" title="Data.Functor.Classes" + >Ord1</a + > g) => <a href="#" title="Data.Functor.Classes" + >Ord1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Ord1:9" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >liftCompare</a + > :: (a -> b -> <a href="#" title="Data.Ord" + >Ordering</a + >) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Data.Ord" + >Ordering</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Read1:10" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Read1</a + > f, <a href="#" title="Data.Functor.Classes" + >Read1</a + > g) => <a href="#" title="Data.Functor.Classes" + >Read1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Read1:10" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >liftReadsPrec</a + > :: (<a href="#" title="Data.Int" + >Int</a + > -> <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > a) -> <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > [a] -> <a href="#" title="Data.Int" + >Int</a + > -> <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >liftReadList</a + > :: (<a href="#" title="Data.Int" + >Int</a + > -> <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > a) -> <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > [a] -> <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > [<a href="#" title="Bug1004" + >Product</a + > f g a] <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >liftReadPrec</a + > :: <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > a -> <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > [a] -> <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >liftReadListPrec</a + > :: <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > a -> <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > [a] -> <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > [<a href="#" title="Bug1004" + >Product</a + > f g a] <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Show1:11" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Show1</a + > f, <a href="#" title="Data.Functor.Classes" + >Show1</a + > g) => <a href="#" title="Data.Functor.Classes" + >Show1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Show1:11" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >liftShowsPrec</a + > :: (<a href="#" title="Data.Int" + >Int</a + > -> a -> <a href="#" title="Text.Show" + >ShowS</a + >) -> ([a] -> <a href="#" title="Text.Show" + >ShowS</a + >) -> <a href="#" title="Data.Int" + >Int</a + > -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Text.Show" + >ShowS</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >liftShowList</a + > :: (<a href="#" title="Data.Int" + >Int</a + > -> a -> <a href="#" title="Text.Show" + >ShowS</a + >) -> ([a] -> <a href="#" title="Text.Show" + >ShowS</a + >) -> [<a href="#" title="Bug1004" + >Product</a + > f g a] -> <a href="#" title="Text.Show" + >ShowS</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:MonadZip:12" + ></span + > (<a href="#" title="Control.Monad.Zip" + >MonadZip</a + > f, <a href="#" title="Control.Monad.Zip" + >MonadZip</a + > g) => <a href="#" title="Control.Monad.Zip" + >MonadZip</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:MonadZip:12" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >mzip</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Bug1004" + >Product</a + > f g (a, b) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >mzipWith</a + > :: (a -> b -> c) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g b -> <a href="#" title="Bug1004" + >Product</a + > f g c <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >munzip</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g (a, b) -> (<a href="#" title="Bug1004" + >Product</a + > f g a, <a href="#" title="Bug1004" + >Product</a + > f g b) <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Alternative:13" + ></span + > (<a href="#" title="Control.Applicative" + >Alternative</a + > f, <a href="#" title="Control.Applicative" + >Alternative</a + > g) => <a href="#" title="Control.Applicative" + >Alternative</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Alternative:13" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >empty</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(<|>)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >some</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g [a] <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >many</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g [a] <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:MonadPlus:14" + ></span + > (<a href="#" title="Control.Monad" + >MonadPlus</a + > f, <a href="#" title="Control.Monad" + >MonadPlus</a + > g) => <a href="#" title="Control.Monad" + >MonadPlus</a + > (<a href="#" title="Bug1004" + >Product</a + > f g)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:MonadPlus:14" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >mzero</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >mplus</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Eq:15" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Eq1</a + > f, <a href="#" title="Data.Functor.Classes" + >Eq1</a + > g, <a href="#" title="Data.Eq" + >Eq</a + > a) => <a href="#" title="Data.Eq" + >Eq</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Eq:15" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >(==)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(/=)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Data:16" + ></span + > (<a href="#" title="Type.Reflection" + >Typeable</a + > a, <a href="#" title="Type.Reflection" + >Typeable</a + > f, <a href="#" title="Type.Reflection" + >Typeable</a + > g, <a href="#" title="Type.Reflection" + >Typeable</a + > k, <a href="#" title="Data.Data" + >Data</a + > (f a), <a href="#" title="Data.Data" + >Data</a + > (g a)) => <a href="#" title="Data.Data" + >Data</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Data:16" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >gfoldl</a + > :: (<span class="keyword" + >forall</span + > d b. <a href="#" title="Data.Data" + >Data</a + > d => c (d -> b) -> d -> c b) -> (<span class="keyword" + >forall</span + > g0. g0 -> c g0) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> c (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gunfold</a + > :: (<span class="keyword" + >forall</span + > b r. <a href="#" title="Data.Data" + >Data</a + > b => c (b -> r) -> c r) -> (<span class="keyword" + >forall</span + > r. r -> c r) -> <a href="#" title="Data.Data" + >Constr</a + > -> c (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >toConstr</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Data" + >Constr</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >dataTypeOf</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Data" + >DataType</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >dataCast1</a + > :: <a href="#" title="Type.Reflection" + >Typeable</a + > t => (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => c (t d)) -> <a href="#" title="Data.Maybe" + >Maybe</a + > (c (<a href="#" title="Bug1004" + >Product</a + > f g a)) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >dataCast2</a + > :: <a href="#" title="Type.Reflection" + >Typeable</a + > t => (<span class="keyword" + >forall</span + > d e. (<a href="#" title="Data.Data" + >Data</a + > d, <a href="#" title="Data.Data" + >Data</a + > e) => c (t d e)) -> <a href="#" title="Data.Maybe" + >Maybe</a + > (c (<a href="#" title="Bug1004" + >Product</a + > f g a)) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapT</a + > :: (<span class="keyword" + >forall</span + > b. <a href="#" title="Data.Data" + >Data</a + > b => b -> b) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapQl</a + > :: (r -> r' -> r) -> r -> (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => d -> r') -> <a href="#" title="Bug1004" + >Product</a + > f g a -> r <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapQr</a + > :: <span class="keyword" + >forall</span + > r r'. (r' -> r -> r) -> r -> (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => d -> r') -> <a href="#" title="Bug1004" + >Product</a + > f g a -> r <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapQ</a + > :: (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => d -> u) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> [u] <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapQi</a + > :: <a href="#" title="Data.Int" + >Int</a + > -> (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => d -> u) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> u <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapM</a + > :: <a href="#" title="Control.Monad" + >Monad</a + > m => (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => d -> m d) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> m (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapMp</a + > :: <a href="#" title="Control.Monad" + >MonadPlus</a + > m => (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => d -> m d) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> m (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >gmapMo</a + > :: <a href="#" title="Control.Monad" + >MonadPlus</a + > m => (<span class="keyword" + >forall</span + > d. <a href="#" title="Data.Data" + >Data</a + > d => d -> m d) -> <a href="#" title="Bug1004" + >Product</a + > f g a -> m (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Ord:17" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Ord1</a + > f, <a href="#" title="Data.Functor.Classes" + >Ord1</a + > g, <a href="#" title="Data.Ord" + >Ord</a + > a) => <a href="#" title="Data.Ord" + >Ord</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Ord:17" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >compare</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Ord" + >Ordering</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(<)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(<=)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(>)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >(>=)</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.Bool" + >Bool</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >max</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >min</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Read:18" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Read1</a + > f, <a href="#" title="Data.Functor.Classes" + >Read1</a + > g, <a href="#" title="Text.Read" + >Read</a + > a) => <a href="#" title="Text.Read" + >Read</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Read:18" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >readsPrec</a + > :: <a href="#" title="Data.Int" + >Int</a + > -> <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >readList</a + > :: <a href="#" title="Text.ParserCombinators.ReadP" + >ReadS</a + > [<a href="#" title="Bug1004" + >Product</a + > f g a] <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >readPrec</a + > :: <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >readListPrec</a + > :: <a href="#" title="Text.ParserCombinators.ReadPrec" + >ReadPrec</a + > [<a href="#" title="Bug1004" + >Product</a + > f g a] <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Show:19" + ></span + > (<a href="#" title="Data.Functor.Classes" + >Show1</a + > f, <a href="#" title="Data.Functor.Classes" + >Show1</a + > g, <a href="#" title="Text.Show" + >Show</a + > a) => <a href="#" title="Text.Show" + >Show</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Show:19" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >showsPrec</a + > :: <a href="#" title="Data.Int" + >Int</a + > -> <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Text.Show" + >ShowS</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >show</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="Data.String" + >String</a + > <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >showList</a + > :: [<a href="#" title="Bug1004" + >Product</a + > f g a] -> <a href="#" title="Text.Show" + >ShowS</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Generic:20" + ></span + > <a href="#" title="GHC.Generics" + >Generic</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a)</span + ></td + ><td class="doc" + ><p + ><em + >Since: base-4.9.0.0</em + ></p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Generic:20" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="subs associated-types" + ><p class="caption" + >Associated Types</p + ><p class="src" + ><span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) :: <a href="#" title="Data.Kind" + >Type</a + > -> <a href="#" title="Data.Kind" + >Type</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >from</a + > :: <a href="#" title="Bug1004" + >Product</a + > f g a -> <a href="#" title="GHC.Generics" + >Rep</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) x <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >to</a + > :: <a href="#" title="GHC.Generics" + >Rep</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) x -> <a href="#" title="Bug1004" + >Product</a + > f g a <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Rep1:21" + ></span + > <span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g :: k -> <a href="#" title="Data.Kind" + >Type</a + >)</span + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Rep1:21" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="src" + ><span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep1</a + > (<a href="#" title="Bug1004" + >Product</a + > f g :: k -> <a href="#" title="Data.Kind" + >Type</a + >) = <a href="#" title="GHC.Generics" + >D1</a + > ('<a href="#" title="GHC.Generics" + >MetaData</a + > "Product" "Data.Functor.Product" "base" '<a href="#" title="Data.Bool" + >False</a + >) (<a href="#" title="GHC.Generics" + >C1</a + > ('<a href="#" title="GHC.Generics" + >MetaCons</a + > "Pair" '<a href="#" title="GHC.Generics" + >PrefixI</a + > '<a href="#" title="Data.Bool" + >False</a + >) (<a href="#" title="GHC.Generics" + >S1</a + > ('<a href="#" title="GHC.Generics" + >MetaSel</a + > ('<a href="#" title="Data.Maybe" + >Nothing</a + > :: <a href="#" title="Data.Maybe" + >Maybe</a + > <a href="#" title="GHC.TypeLits" + >Symbol</a + >) '<a href="#" title="GHC.Generics" + >NoSourceUnpackedness</a + > '<a href="#" title="GHC.Generics" + >NoSourceStrictness</a + > '<a href="#" title="GHC.Generics" + >DecidedLazy</a + >) (<a href="#" title="GHC.Generics" + >Rec1</a + > f) <a href="#" title="GHC.Generics" + >:*:</a + > <a href="#" title="GHC.Generics" + >S1</a + > ('<a href="#" title="GHC.Generics" + >MetaSel</a + > ('<a href="#" title="Data.Maybe" + >Nothing</a + > :: <a href="#" title="Data.Maybe" + >Maybe</a + > <a href="#" title="GHC.TypeLits" + >Symbol</a + >) '<a href="#" title="GHC.Generics" + >NoSourceUnpackedness</a + > '<a href="#" title="GHC.Generics" + >NoSourceStrictness</a + > '<a href="#" title="GHC.Generics" + >DecidedLazy</a + >) (<a href="#" title="GHC.Generics" + >Rec1</a + > g)))</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Product:Rep:22" + ></span + > <span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a)</span + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Product:Rep:22" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Data.Functor.Product</a + ></p + > <div class="src" + ><span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep</a + > (<a href="#" title="Bug1004" + >Product</a + > f g a) = <a href="#" title="GHC.Generics" + >D1</a + > ('<a href="#" title="GHC.Generics" + >MetaData</a + > "Product" "Data.Functor.Product" "base" '<a href="#" title="Data.Bool" + >False</a + >) (<a href="#" title="GHC.Generics" + >C1</a + > ('<a href="#" title="GHC.Generics" + >MetaCons</a + > "Pair" '<a href="#" title="GHC.Generics" + >PrefixI</a + > '<a href="#" title="Data.Bool" + >False</a + >) (<a href="#" title="GHC.Generics" + >S1</a + > ('<a href="#" title="GHC.Generics" + >MetaSel</a + > ('<a href="#" title="Data.Maybe" + >Nothing</a + > :: <a href="#" title="Data.Maybe" + >Maybe</a + > <a href="#" title="GHC.TypeLits" + >Symbol</a + >) '<a href="#" title="GHC.Generics" + >NoSourceUnpackedness</a + > '<a href="#" title="GHC.Generics" + >NoSourceStrictness</a + > '<a href="#" title="GHC.Generics" + >DecidedLazy</a + >) (<a href="#" title="GHC.Generics" + >Rec0</a + > (f a)) <a href="#" title="GHC.Generics" + >:*:</a + > <a href="#" title="GHC.Generics" + >S1</a + > ('<a href="#" title="GHC.Generics" + >MetaSel</a + > ('<a href="#" title="Data.Maybe" + >Nothing</a + > :: <a href="#" title="Data.Maybe" + >Maybe</a + > <a href="#" title="GHC.TypeLits" + >Symbol</a + >) '<a href="#" title="GHC.Generics" + >NoSourceUnpackedness</a + > '<a href="#" title="GHC.Generics" + >NoSourceStrictness</a + > '<a href="#" title="GHC.Generics" + >DecidedLazy</a + >) (<a href="#" title="GHC.Generics" + >Rec0</a + > (g a))))</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/Bug1033.html b/html-test/ref/Bug1033.html new file mode 100644 index 00000000..736fb2ad --- /dev/null +++ b/html-test/ref/Bug1033.html @@ -0,0 +1,220 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Bug1033</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Bug1033</p + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Foo" class="def" + >Foo</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:Foo" class="def" + >Foo</a + ></td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Foo" + >Instances</h4 + ><details id="i:Foo" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Foo:Generic:1" + ></span + > <a href="#" title="GHC.Generics" + >Generic</a + > <a href="#" title="Bug1033" + >Foo</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc" + ><p + >This does some generic foos.</p + ></td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Foo:Generic:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1033</a + ></p + > <div class="subs associated-types" + ><p class="caption" + >Associated Types</p + ><p class="src" + ><span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep</a + > <a href="#" title="Bug1033" + >Foo</a + > :: <a href="#" title="Data.Kind" + >Type</a + > -> <a href="#" title="Data.Kind" + >Type</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + > <div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a href="#" + >from</a + > :: <a href="#" title="Bug1033" + >Foo</a + > -> <a href="#" title="GHC.Generics" + >Rep</a + > <a href="#" title="Bug1033" + >Foo</a + > x <a href="#" class="selflink" + >#</a + ></p + ><p class="src" + ><a href="#" + >to</a + > :: <a href="#" title="GHC.Generics" + >Rep</a + > <a href="#" title="Bug1033" + >Foo</a + > x -> <a href="#" title="Bug1033" + >Foo</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:Foo:Rep:2" + ></span + > <span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep</a + > <a href="#" title="Bug1033" + >Foo</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:Foo:Rep:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1033</a + ></p + > <div class="src" + ><span class="keyword" + >type</span + > <a href="#" title="GHC.Generics" + >Rep</a + > <a href="#" title="Bug1033" + >Foo</a + > = <a href="#" title="GHC.Generics" + >D1</a + > ('<a href="#" title="GHC.Generics" + >MetaData</a + > "Foo" "Bug1033" "main" '<a href="#" title="Data.Bool" + >False</a + >) (<a href="#" title="GHC.Generics" + >C1</a + > ('<a href="#" title="GHC.Generics" + >MetaCons</a + > "Foo" '<a href="#" title="GHC.Generics" + >PrefixI</a + > '<a href="#" title="Data.Bool" + >False</a + >) (<a href="#" title="GHC.Generics" + >U1</a + > :: <a href="#" title="Data.Kind" + >Type</a + > -> <a href="#" title="Data.Kind" + >Type</a + >))</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/Bug1035.html b/html-test/ref/Bug1035.html new file mode 100644 index 00000000..5e4d6f82 --- /dev/null +++ b/html-test/ref/Bug1035.html @@ -0,0 +1,144 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Bug1035</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Bug1035</p + ></div + ><div id="synopsis" + ><details id="syn" + ><summary + >Synopsis</summary + ><ul class="details-toggle" data-details-id="syn" + ><li class="src short" + ><span class="keyword" + >data</span + > <a href="#" + >Foo</a + > = <a href="#" + >Bar</a + ></li + ><li class="src short" + ><span class="keyword" + >data</span + > <a href="#" + >Bar</a + > = <a href="#" + >Foo</a + ></li + ><li class="src short" + ><a href="#" + >foo</a + > :: ()</li + ></ul + ></details + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Foo" class="def" + >Foo</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:Bar" class="def" + >Bar</a + ></td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Bar" class="def" + >Bar</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:Foo" class="def" + >Foo</a + ></td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ></div + ><div class="top" + ><p class="src" + ><a id="v:foo" class="def" + >foo</a + > :: () <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >A link to <code + ><a href="#" title="Bug1035" + >Bar</a + ></code + ></p + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/Bug1063.html b/html-test/ref/Bug1063.html new file mode 100644 index 00000000..f311373a --- /dev/null +++ b/html-test/ref/Bug1063.html @@ -0,0 +1,98 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Bug1063</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Bug1063</p + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >class</span + > (c => d) => <a id="t:Implies" class="def" + >Implies</a + > c d <a href="#" class="selflink" + >#</a + ></p + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Implies" + >Instances</h4 + ><details id="i:Implies" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Implies:Implies:1" + ></span + > (c => d) => <a href="#" title="Bug1063" + >Implies</a + > c d</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:ic:Implies:Implies:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1063</a + ></p + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/Bug1103.html b/html-test/ref/Bug1103.html new file mode 100644 index 00000000..4d3772d1 --- /dev/null +++ b/html-test/ref/Bug1103.html @@ -0,0 +1,554 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Bug1103</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Bug1103</p + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data family</span + > <a id="t:Foo1" class="def" + >Foo1</a + > :: <a href="#" title="Data.Kind" + >Type</a + > -> <a href="#" title="Data.Kind" + >Type</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Foo1" + >Instances</h4 + ><details id="i:Foo1" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo1:Foo1:1" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > <a href="#" title="Data.Bool" + >Bool</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo1:Foo1:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > <a href="#" title="Data.Bool" + >Bool</a + > = <a id="v:Foo1Bool" class="def" + >Foo1Bool</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo1:Foo1:2" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo1:Foo1:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo1</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a)</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data family</span + > <a id="t:Foo2" class="def" + >Foo2</a + > :: k -> <a href="#" title="Data.Kind" + >Type</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Foo2" + >Instances</h4 + ><details id="i:Foo2" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:1" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:2" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > <a href="#" title="Data.Bool" + >Bool</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > <a href="#" title="Data.Bool" + >Bool</a + > = <a id="v:Foo2Bool" class="def" + >Foo2Bool</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:3" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:3" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo2:Foo2:4" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo2:Foo2:4" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo2</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data family</span + > <a id="t:Foo3" class="def" + >Foo3</a + > :: k <a href="#" class="selflink" + >#</a + ></p + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Foo3" + >Instances</h4 + ><details id="i:Foo3" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:1" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:2" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:3" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:3" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (a :: <a href="#" title="Data.Char" + >Char</a + > -> <a href="#" title="Data.Char" + >Char</a + >)</div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:4" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > <a href="#" title="Data.Bool" + >Bool</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:4" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > <a href="#" title="Data.Bool" + >Bool</a + > = <a id="v:Foo3Bool" class="def" + >Foo3Bool</a + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:if:Foo3:Foo3:5" + ></span + > <span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:if:Foo3:Foo3:5" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug1103</a + ></p + > <div class="src" + ><span class="keyword" + >data</span + > <a href="#" title="Bug1103" + >Foo3</a + > (<a href="#" title="Data.Maybe" + >Maybe</a + > a :: <a href="#" title="Data.Kind" + >Type</a + >)</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/Bug195.html b/html-test/ref/Bug195.html index e1cf073b..af595d5d 100644 --- a/html-test/ref/Bug195.html +++ b/html-test/ref/Bug195.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug195</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug2.html b/html-test/ref/Bug2.html index 5a71f78a..c0c192c9 100644 --- a/html-test/ref/Bug2.html +++ b/html-test/ref/Bug2.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug2</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug201.html b/html-test/ref/Bug201.html index 6d12ed70..13ad4556 100644 --- a/html-test/ref/Bug201.html +++ b/html-test/ref/Bug201.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug201</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug253.html b/html-test/ref/Bug253.html index c7945ec6..a482a21a 100644 --- a/html-test/ref/Bug253.html +++ b/html-test/ref/Bug253.html @@ -4,9 +4,9 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug253</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" - /><link rel="stylesheet" type="text/css" href="#" - /><link rel="stylesheet" type="text/css" href="#" + ><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="quick-jump.css" + /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" ></script ><script type="text/x-mathjax-config" @@ -20,11 +20,11 @@ > </span ><ul class="links" id="page-menu" ><li - ><a href="#" + ><a href="index.html" >Contents</a ></li ><li - ><a href="#" + ><a href="doc-index.html" >Index</a ></li ></ul @@ -64,7 +64,7 @@ >Synopsis</summary ><ul class="details-toggle" data-details-id="syn" ><li class="src short" - ><a href="#" + ><a href="#v:foo" >foo</a > :: ()</li ></ul @@ -77,7 +77,7 @@ ><p class="src" ><a id="v:foo" class="def" >foo</a - > :: () <a href="#" class="selflink" + > :: () <a href="#v:foo" class="selflink" >#</a ></p ><div class="doc" @@ -85,7 +85,7 @@ >This link should generate <code >#v</code > anchor: <code - ><a href="#" title="DoesNotExist" + ><a href="DoesNotExist.html#v:fakeFakeFake" title="DoesNotExist" >fakeFakeFake</a ></code ></p diff --git a/html-test/ref/Bug26.html b/html-test/ref/Bug26.html index 50f21700..5c6fb34e 100644 --- a/html-test/ref/Bug26.html +++ b/html-test/ref/Bug26.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug26</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug280.html b/html-test/ref/Bug280.html index b6994e7c..6a4aa63e 100644 --- a/html-test/ref/Bug280.html +++ b/html-test/ref/Bug280.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug280</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug294.html b/html-test/ref/Bug294.html index 7c70e9dc..6ceb3422 100644 --- a/html-test/ref/Bug294.html +++ b/html-test/ref/Bug294.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug294</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug298.html b/html-test/ref/Bug298.html index 309a47e9..fc57d087 100644 --- a/html-test/ref/Bug298.html +++ b/html-test/ref/Bug298.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug298</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug3.html b/html-test/ref/Bug3.html index 4ac29e8f..0c9d8526 100644 --- a/html-test/ref/Bug3.html +++ b/html-test/ref/Bug3.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug3</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug308.html b/html-test/ref/Bug308.html index 35424874..acd019d3 100644 --- a/html-test/ref/Bug308.html +++ b/html-test/ref/Bug308.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug308</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug308CrossModule.html b/html-test/ref/Bug308CrossModule.html index 7393cd3a..f754aa87 100644 --- a/html-test/ref/Bug308CrossModule.html +++ b/html-test/ref/Bug308CrossModule.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug308CrossModule</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug310.html b/html-test/ref/Bug310.html index c05b475a..59faf609 100644 --- a/html-test/ref/Bug310.html +++ b/html-test/ref/Bug310.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug310</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug313.html b/html-test/ref/Bug313.html index 2a4a9202..83ee7a34 100644 --- a/html-test/ref/Bug313.html +++ b/html-test/ref/Bug313.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug313</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug335.html b/html-test/ref/Bug335.html index dc72c08f..00e31ca0 100644 --- a/html-test/ref/Bug335.html +++ b/html-test/ref/Bug335.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug335</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" @@ -69,7 +69,7 @@ >#</a ></p ><div class="doc" - ><h3 class="caption details-toggle-control details-toggle" data-details-id="ch:f0" + ><h3 class="subheading details-toggle-control details-toggle" data-details-id="ch:f0" >ExF:</h3 ><details id="ch:f0" ><summary class="hide-when-js-enabled" @@ -87,7 +87,7 @@ >#</a ></p ><div class="doc" - ><h3 class="caption details-toggle-control details-toggle" data-details-id="ch:g0" + ><h3 class="subheading details-toggle-control details-toggle" data-details-id="ch:g0" >ExG:</h3 ><details id="ch:g0" ><summary class="hide-when-js-enabled" diff --git a/html-test/ref/Bug387.html b/html-test/ref/Bug387.html index 446325c7..12887a83 100644 --- a/html-test/ref/Bug387.html +++ b/html-test/ref/Bug387.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug387</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug4.html b/html-test/ref/Bug4.html index 342ee675..8a19bc6b 100644 --- a/html-test/ref/Bug4.html +++ b/html-test/ref/Bug4.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug4</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug458.html b/html-test/ref/Bug458.html index 8809c229..d5b5a768 100644 --- a/html-test/ref/Bug458.html +++ b/html-test/ref/Bug458.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug458</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug466.html b/html-test/ref/Bug466.html new file mode 100644 index 00000000..4f6f6f16 --- /dev/null +++ b/html-test/ref/Bug466.html @@ -0,0 +1,246 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Bug466</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Bug466</p + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >class</span + > <a id="t:Cl" class="def" + >Cl</a + > a <a href="#" class="selflink" + >#</a + ></p + ><div class="subs associated-types" + ><p class="caption" + >Associated Types</p + ><p class="src" + ><span class="keyword" + >type</span + > <a id="t:Fam" class="def" + >Fam</a + > a :: [*] <a href="#" class="selflink" + >#</a + ></p + ></div + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:Cl" + >Instances</h4 + ><details id="i:Cl" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:Cl:Cl:1" + ></span + > <a href="#" title="Bug466" + >Cl</a + > <a href="#" title="Bug466" + >X</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:ic:Cl:Cl:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug466</a + ></p + > <div class="subs associated-types" + ><p class="caption" + >Associated Types</p + ><p class="src" + ><span class="keyword" + >type</span + > <a href="#" title="Bug466" + >Fam</a + > <a href="#" title="Bug466" + >X</a + > :: [<a href="#" title="Data.Kind" + >Type</a + >] <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:X" class="def" + >X</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:X" class="def" + >X</a + ></td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ><div class="subs instances" + ><h4 class="instances details-toggle-control details-toggle" data-details-id="i:X" + >Instances</h4 + ><details id="i:X" open="open" + ><summary class="hide-when-js-enabled" + >Instances details</summary + ><table + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:X:Cl:1" + ></span + > <a href="#" title="Bug466" + >Cl</a + > <a href="#" title="Bug466" + >X</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:X:Cl:1" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug466</a + ></p + > <div class="subs associated-types" + ><p class="caption" + >Associated Types</p + ><p class="src" + ><span class="keyword" + >type</span + > <a href="#" title="Bug466" + >Fam</a + > <a href="#" title="Bug466" + >X</a + > :: [<a href="#" title="Data.Kind" + >Type</a + >] <a href="#" class="selflink" + >#</a + ></p + ></div + ></details + ></td + ></tr + ><tr + ><td class="src clearfix" + ><span class="inst-left" + ><span class="instance details-toggle-control details-toggle" data-details-id="i:id:X:Fam:2" + ></span + > <span class="keyword" + >type</span + > <a href="#" title="Bug466" + >Fam</a + > <a href="#" title="Bug466" + >X</a + ></span + > <a href="#" class="selflink" + >#</a + ></td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td colspan="2" + ><details id="i:id:X:Fam:2" + ><summary class="hide-when-js-enabled" + >Instance details</summary + ><p + >Defined in <a href="#" + >Bug466</a + ></p + > <div class="src" + ><span class="keyword" + >type</span + > <a href="#" title="Bug466" + >Fam</a + > <a href="#" title="Bug466" + >X</a + > = '[<a href="#" title="Data.Char" + >Char</a + >]</div + ></details + ></td + ></tr + ></table + ></details + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/Bug546.html b/html-test/ref/Bug546.html index 9c1dadae..bb400a50 100644 --- a/html-test/ref/Bug546.html +++ b/html-test/ref/Bug546.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug546</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug548.html b/html-test/ref/Bug548.html index 537dc0ff..dc2128ee 100644 --- a/html-test/ref/Bug548.html +++ b/html-test/ref/Bug548.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug548</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" @@ -114,8 +114,12 @@ >Type</a >)</span ></td - ><td class="doc empty" - > </td + ><td class="doc" + ><p + ><em + >Since: base-4.7.0.0</em + ></p + ></td ></tr ><tr ><td colspan="2" @@ -414,8 +418,12 @@ >WrappedArrow</a > a b c)</span ></td - ><td class="doc empty" - > </td + ><td class="doc" + ><p + ><em + >Since: base-4.7.0.0</em + ></p + ></td ></tr ><tr ><td colspan="2" @@ -492,12 +500,8 @@ >Type</a >)</span ></td - ><td class="doc" - ><p - ><em - >Since: base-4.7.0.0</em - ></p - ></td + ><td class="doc empty" + > </td ></tr ><tr ><td colspan="2" @@ -564,12 +568,8 @@ >WrappedArrow</a > a b c)</span ></td - ><td class="doc" - ><p - ><em - >Since: base-4.7.0.0</em - ></p - ></td + ><td class="doc empty" + > </td ></tr ><tr ><td colspan="2" diff --git a/html-test/ref/Bug574.html b/html-test/ref/Bug574.html index f087302c..3c7cf13f 100644 --- a/html-test/ref/Bug574.html +++ b/html-test/ref/Bug574.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug574</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug6.html b/html-test/ref/Bug6.html index 0e994a74..5bd4c030 100644 --- a/html-test/ref/Bug6.html +++ b/html-test/ref/Bug6.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug6</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug613.html b/html-test/ref/Bug613.html index 271ea598..4df6037d 100644 --- a/html-test/ref/Bug613.html +++ b/html-test/ref/Bug613.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug613</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug647.html b/html-test/ref/Bug647.html index 25a3f004..0648cf51 100644 --- a/html-test/ref/Bug647.html +++ b/html-test/ref/Bug647.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug647</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug679.html b/html-test/ref/Bug679.html index 9b7dcb86..2434a857 100644 --- a/html-test/ref/Bug679.html +++ b/html-test/ref/Bug679.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug679</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug7.html b/html-test/ref/Bug7.html index 1faee70f..5338bda2 100644 --- a/html-test/ref/Bug7.html +++ b/html-test/ref/Bug7.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug7</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug8.html b/html-test/ref/Bug8.html index eb737305..73890845 100644 --- a/html-test/ref/Bug8.html +++ b/html-test/ref/Bug8.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug8</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug85.html b/html-test/ref/Bug85.html index 05a17841..bbef4d32 100644 --- a/html-test/ref/Bug85.html +++ b/html-test/ref/Bug85.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug85</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug865.html b/html-test/ref/Bug865.html index 6bb54786..96f64daf 100644 --- a/html-test/ref/Bug865.html +++ b/html-test/ref/Bug865.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug865</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug923.html b/html-test/ref/Bug923.html index 92b0f4d9..d657e08e 100644 --- a/html-test/ref/Bug923.html +++ b/html-test/ref/Bug923.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug923</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bug953.html b/html-test/ref/Bug953.html index 5a54761a..aea7ec5c 100644 --- a/html-test/ref/Bug953.html +++ b/html-test/ref/Bug953.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bug953</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" @@ -81,7 +81,7 @@ ><div class="doc" ><p >A foo</p - ><h4 class="caption details-toggle-control details-toggle" data-details-id="ch:Foo0" + ><h4 class="subheading details-toggle-control details-toggle" data-details-id="ch:Foo0" >Examples</h4 ><details id="ch:Foo0" ><summary class="hide-when-js-enabled" @@ -117,7 +117,7 @@ ><div class="doc" ><p >A bar</p - ><h4 class="caption details-toggle-control details-toggle" data-details-id="ch:Bar0" + ><h4 class="subheading details-toggle-control details-toggle" data-details-id="ch:Bar0" >Examples</h4 ><details id="ch:Bar0" ><summary class="hide-when-js-enabled" diff --git a/html-test/ref/Bug973.html b/html-test/ref/Bug973.html new file mode 100644 index 00000000..20e27886 --- /dev/null +++ b/html-test/ref/Bug973.html @@ -0,0 +1,172 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Bug973</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Bug973</p + ></div + ><div id="synopsis" + ><details id="syn" + ><summary + >Synopsis</summary + ><ul class="details-toggle" data-details-id="syn" + ><li class="src short" + ><a href="#" + >showRead</a + > :: <span class="keyword" + >forall</span + > a b. (<a href="#" title="Text.Show" + >Show</a + > a, <a href="#" title="Text.Read" + >Read</a + > b) => a -> b</li + ><li class="src short" + ><a href="#" + >showRead'</a + > :: <span class="keyword" + >forall</span + > b a. (<a href="#" title="Text.Show" + >Show</a + > a, <a href="#" title="Text.Read" + >Read</a + > b) => a -> b</li + ></ul + ></details + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><a id="v:showRead" class="def" + >showRead</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs arguments" + ><p class="caption" + >Arguments</p + ><table + ><tr + ><td class="src" + >:: <span class="keyword" + >forall</span + > a b. (<a href="#" title="Text.Show" + >Show</a + > a, <a href="#" title="Text.Read" + >Read</a + > b)</td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td class="src" + >=> a</td + ><td class="doc" + ><p + >this gets turned into a string...</p + ></td + ></tr + ><tr + ><td class="src" + >-> b</td + ><td class="doc" + ><p + >...from which this is read</p + ></td + ></tr + ></table + ></div + ></div + ><div class="top" + ><p class="src" + ><a id="v:showRead-39-" class="def" + >showRead'</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs arguments" + ><p class="caption" + >Arguments</p + ><table + ><tr + ><td class="src" + >:: <span class="keyword" + >forall</span + > b a. (<a href="#" title="Text.Show" + >Show</a + > a, <a href="#" title="Text.Read" + >Read</a + > b)</td + ><td class="doc empty" + > </td + ></tr + ><tr + ><td class="src" + >=> a</td + ><td class="doc" + ><p + >this gets turned into a string...</p + ></td + ></tr + ><tr + ><td class="src" + >-> b</td + ><td class="doc" + ><p + >...from which this is read</p + ></td + ></tr + ></table + ></div + ><div class="doc" + ><p + >Same as <code + ><a href="#" title="Bug973" + >showRead</a + ></code + >, but with type variable order flipped</p + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/BugDeprecated.html b/html-test/ref/BugDeprecated.html index b0ced018..92a963f3 100644 --- a/html-test/ref/BugDeprecated.html +++ b/html-test/ref/BugDeprecated.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >BugDeprecated</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/BugExportHeadings.html b/html-test/ref/BugExportHeadings.html index 02f36f7c..ddcb7aa3 100644 --- a/html-test/ref/BugExportHeadings.html +++ b/html-test/ref/BugExportHeadings.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >BugExportHeadings</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Bugs.html b/html-test/ref/Bugs.html index c95dd703..c6c42446 100644 --- a/html-test/ref/Bugs.html +++ b/html-test/ref/Bugs.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Bugs</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/BundledPatterns.html b/html-test/ref/BundledPatterns.html index afa12e2b..fb6518af 100644 --- a/html-test/ref/BundledPatterns.html +++ b/html-test/ref/BundledPatterns.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >BundledPatterns</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/BundledPatterns2.html b/html-test/ref/BundledPatterns2.html index 48493cf9..b680fe66 100644 --- a/html-test/ref/BundledPatterns2.html +++ b/html-test/ref/BundledPatterns2.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >BundledPatterns2</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/ConstructorArgs.html b/html-test/ref/ConstructorArgs.html index f13fabe8..16ef6780 100644 --- a/html-test/ref/ConstructorArgs.html +++ b/html-test/ref/ConstructorArgs.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >ConstructorArgs</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/ConstructorPatternExport.html b/html-test/ref/ConstructorPatternExport.html index 953fd89b..0822733d 100644 --- a/html-test/ref/ConstructorPatternExport.html +++ b/html-test/ref/ConstructorPatternExport.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >ConstructorPatternExport</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DefaultAssociatedTypes.html b/html-test/ref/DefaultAssociatedTypes.html new file mode 100644 index 00000000..4b39483a --- /dev/null +++ b/html-test/ref/DefaultAssociatedTypes.html @@ -0,0 +1,154 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >DefaultAssociatedTypes</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >DefaultAssociatedTypes</p + ></div + ><div id="synopsis" + ><details id="syn" + ><summary + >Synopsis</summary + ><ul class="details-toggle" data-details-id="syn" + ><li class="src short" + ><span class="keyword" + >class</span + > <a href="#" + >Foo</a + > a <span class="keyword" + >where</span + ><ul class="subs" + ><li + ><span class="keyword" + >type</span + > <a href="#" + >Qux</a + > a :: *</li + ><li + ><a href="#" + >bar</a + >, <a href="#" + >baz</a + > :: a -> <a href="#" title="Data.String" + >String</a + ></li + ></ul + ></li + ></ul + ></details + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >class</span + > <a id="t:Foo" class="def" + >Foo</a + > a <span class="keyword" + >where</span + > <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Documentation for Foo.</p + ></div + ><div class="subs associated-types" + ><p class="caption" + >Associated Types</p + ><p class="src" + ><span class="keyword" + >type</span + > <a id="t:Qux" class="def" + >Qux</a + > a :: * <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Doc for Qux</p + ></div + > <div class="subs default" + ><p class="caption" + ></p + ><p class="src" + ><span class="keyword" + >type</span + > <a href="#" title="DefaultAssociatedTypes" + >Qux</a + > a = [a]</p + ></div + ></div + ><div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a id="v:bar" class="def" + >bar</a + > :: a -> <a href="#" title="Data.String" + >String</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Documentation for bar and baz.</p + ></div + ><p class="src" + ><a id="v:baz" class="def" + >baz</a + > :: a -> <a href="#" title="Data.String" + >String</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Documentation for bar and baz.</p + ></div + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/DefaultSignatures.html b/html-test/ref/DefaultSignatures.html new file mode 100644 index 00000000..60d0428f --- /dev/null +++ b/html-test/ref/DefaultSignatures.html @@ -0,0 +1,180 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >DefaultSignatures</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >DefaultSignatures</p + ></div + ><div id="synopsis" + ><details id="syn" + ><summary + >Synopsis</summary + ><ul class="details-toggle" data-details-id="syn" + ><li class="src short" + ><span class="keyword" + >class</span + > <a href="#" + >Foo</a + > a <span class="keyword" + >where</span + ><ul class="subs" + ><li + ><a href="#" + >bar</a + >, <a href="#" + >baz</a + > :: a -> <a href="#" title="Data.String" + >String</a + ></li + ><li + ><a href="#" + >baz'</a + > :: <a href="#" title="Data.String" + >String</a + > -> a</li + ></ul + ></li + ></ul + ></details + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >class</span + > <a id="t:Foo" class="def" + >Foo</a + > a <span class="keyword" + >where</span + > <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Documentation for Foo.</p + ></div + ><div class="subs minimal" + ><p class="caption" + >Minimal complete definition</p + ><p class="src" + ><a href="#" title="DefaultSignatures" + >baz</a + ></p + ></div + ><div class="subs methods" + ><p class="caption" + >Methods</p + ><p class="src" + ><a id="v:bar" class="def" + >bar</a + > :: a -> <a href="#" title="Data.String" + >String</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Documentation for bar and baz.</p + ></div + > <div class="subs default" + ><p class="caption" + ></p + ><p class="src" + ><span class="keyword" + >default</span + > <a id="v:bar" class="def" + >bar</a + > :: <a href="#" title="Text.Show" + >Show</a + > a => a -> <a href="#" title="Data.String" + >String</a + > <a href="#" class="selflink" + >#</a + ></p + ></div + ><p class="src" + ><a id="v:baz" class="def" + >baz</a + > :: a -> <a href="#" title="Data.String" + >String</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Documentation for bar and baz.</p + ></div + ><p class="src" + ><a id="v:baz-39-" class="def" + >baz'</a + > :: <a href="#" title="Data.String" + >String</a + > -> a <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >Documentation for baz'.</p + ></div + > <div class="subs default" + ><p class="caption" + ></p + ><p class="src" + ><span class="keyword" + >default</span + > <a id="v:baz-39-" class="def" + >baz'</a + > :: <a href="#" title="Text.Read" + >Read</a + > a => <a href="#" title="Data.String" + >String</a + > -> a <a href="#" class="selflink" + >#</a + ></p + ></div + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/DeprecatedClass.html b/html-test/ref/DeprecatedClass.html index cb492a91..a0de4858 100644 --- a/html-test/ref/DeprecatedClass.html +++ b/html-test/ref/DeprecatedClass.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedClass</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedData.html b/html-test/ref/DeprecatedData.html index 1dc6dd49..001970df 100644 --- a/html-test/ref/DeprecatedData.html +++ b/html-test/ref/DeprecatedData.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedData</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedFunction.html b/html-test/ref/DeprecatedFunction.html index 1576c185..2b3c4a66 100644 --- a/html-test/ref/DeprecatedFunction.html +++ b/html-test/ref/DeprecatedFunction.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedFunction</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedFunction2.html b/html-test/ref/DeprecatedFunction2.html index fce0e6b4..a2cd84a2 100644 --- a/html-test/ref/DeprecatedFunction2.html +++ b/html-test/ref/DeprecatedFunction2.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedFunction2</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedFunction3.html b/html-test/ref/DeprecatedFunction3.html index 43b5047e..90bde84d 100644 --- a/html-test/ref/DeprecatedFunction3.html +++ b/html-test/ref/DeprecatedFunction3.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedFunction3</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedModule.html b/html-test/ref/DeprecatedModule.html index 333a9b66..c4d1c241 100644 --- a/html-test/ref/DeprecatedModule.html +++ b/html-test/ref/DeprecatedModule.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedModule</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedModule2.html b/html-test/ref/DeprecatedModule2.html index d2bbdc87..b1d6c12a 100644 --- a/html-test/ref/DeprecatedModule2.html +++ b/html-test/ref/DeprecatedModule2.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedModule2</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedNewtype.html b/html-test/ref/DeprecatedNewtype.html index d66c1b66..4fad244a 100644 --- a/html-test/ref/DeprecatedNewtype.html +++ b/html-test/ref/DeprecatedNewtype.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedNewtype</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedReExport.html b/html-test/ref/DeprecatedReExport.html index edbeace5..d8dd554f 100644 --- a/html-test/ref/DeprecatedReExport.html +++ b/html-test/ref/DeprecatedReExport.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedReExport</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedRecord.html b/html-test/ref/DeprecatedRecord.html index ff1d0166..7760386d 100644 --- a/html-test/ref/DeprecatedRecord.html +++ b/html-test/ref/DeprecatedRecord.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedRecord</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedTypeFamily.html b/html-test/ref/DeprecatedTypeFamily.html index e037af88..76a9a039 100644 --- a/html-test/ref/DeprecatedTypeFamily.html +++ b/html-test/ref/DeprecatedTypeFamily.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedTypeFamily</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DeprecatedTypeSynonym.html b/html-test/ref/DeprecatedTypeSynonym.html index a9573b40..32c9721b 100644 --- a/html-test/ref/DeprecatedTypeSynonym.html +++ b/html-test/ref/DeprecatedTypeSynonym.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DeprecatedTypeSynonym</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/DuplicateRecordFields.html b/html-test/ref/DuplicateRecordFields.html index 4981de8a..fab57a04 100644 --- a/html-test/ref/DuplicateRecordFields.html +++ b/html-test/ref/DuplicateRecordFields.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >DuplicateRecordFields</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Examples.html b/html-test/ref/Examples.html index 43f3a321..f5a7ba8c 100644 --- a/html-test/ref/Examples.html +++ b/html-test/ref/Examples.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Examples</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Extensions.html b/html-test/ref/Extensions.html index 9fdf739f..7be5fd80 100644 --- a/html-test/ref/Extensions.html +++ b/html-test/ref/Extensions.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Extensions</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/FunArgs.html b/html-test/ref/FunArgs.html index 8f8a12e2..03a97522 100644 --- a/html-test/ref/FunArgs.html +++ b/html-test/ref/FunArgs.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >FunArgs</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" @@ -58,7 +58,9 @@ ><table ><tr ><td class="src" - >:: <a href="#" title="Data.Ord" + >:: <span class="keyword" + >forall</span + > a. <a href="#" title="Data.Ord" >Ord</a > a</td ><td class="doc empty" @@ -170,7 +172,9 @@ ><table ><tr ><td class="src" - >:: a</td + >:: <span class="keyword" + >forall</span + > a b c. a</td ><td class="doc" ><p >First argument</p @@ -194,7 +198,9 @@ ></tr ><tr ><td class="src" - >-> d</td + >-> <span class="keyword" + >forall</span + > d. d</td ><td class="doc" ><p >Result</p @@ -218,7 +224,7 @@ ><td class="src" >:: <span class="keyword" >forall</span - > (b :: ()). d ~ '<a href="#" title="GHC.Tuple" + > a (b :: ()) d. d ~ '<a href="#" title="GHC.Tuple" >()</a ></td ><td class="doc empty" @@ -226,7 +232,9 @@ ></tr ><tr ><td class="src" - >=> a b c d</td + >=> <span class="keyword" + >forall</span + > c. a b c d</td ><td class="doc" ><p >abcd</p @@ -258,7 +266,7 @@ ><td class="src" >:: <span class="keyword" >forall</span - > (a :: ()). proxy a</td + > proxy (a :: ()) b. proxy a</td ><td class="doc" ><p >First argument</p diff --git a/html-test/ref/GADTRecords.html b/html-test/ref/GADTRecords.html index 133f4b7e..9dac0c13 100644 --- a/html-test/ref/GADTRecords.html +++ b/html-test/ref/GADTRecords.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >GADTRecords</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/GadtConstructorArgs.html b/html-test/ref/GadtConstructorArgs.html index ee4d1708..c1a4dedf 100644 --- a/html-test/ref/GadtConstructorArgs.html +++ b/html-test/ref/GadtConstructorArgs.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >GadtConstructorArgs</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Hash.html b/html-test/ref/Hash.html index d8ca2d00..8c062e1b 100644 --- a/html-test/ref/Hash.html +++ b/html-test/ref/Hash.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Hash</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/HiddenInstances.html b/html-test/ref/HiddenInstances.html index e39ee307..181b47f8 100644 --- a/html-test/ref/HiddenInstances.html +++ b/html-test/ref/HiddenInstances.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >HiddenInstances</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/HiddenInstancesB.html b/html-test/ref/HiddenInstancesB.html index db4ffaf8..579f5754 100644 --- a/html-test/ref/HiddenInstancesB.html +++ b/html-test/ref/HiddenInstancesB.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >HiddenInstancesB</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Hyperlinks.html b/html-test/ref/Hyperlinks.html index 38915a44..947d5342 100644 --- a/html-test/ref/Hyperlinks.html +++ b/html-test/ref/Hyperlinks.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Hyperlinks</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Identifiers.html b/html-test/ref/Identifiers.html new file mode 100644 index 00000000..c89e7434 --- /dev/null +++ b/html-test/ref/Identifiers.html @@ -0,0 +1,284 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >Identifiers</title + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="#" + /><link rel="stylesheet" type="text/css" href="#" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="#" + >Contents</a + ></li + ><li + ><a href="#" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >Identifiers</p + ></div + ><div id="synopsis" + ><details id="syn" + ><summary + >Synopsis</summary + ><ul class="details-toggle" data-details-id="syn" + ><li class="src short" + ><span class="keyword" + >data</span + > <a href="#" + >Id</a + > = <a href="#" + >Id</a + ></li + ><li class="src short" + ><span class="keyword" + >data</span + > a <a href="#" + >:*</a + > b = a <a href="#" + >:*</a + > b</li + ><li class="src short" + ><a href="#" + >foo</a + > :: ()</li + ></ul + ></details + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Id" class="def" + >Id</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:Id" class="def" + >Id</a + ></td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > a <a id="t::-42-" class="def" + >:*</a + > b <a href="#" class="selflink" + >#</a + ></p + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + >a <a id="v::-42-" class="def" + >:*</a + > b</td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ></div + ><div class="top" + ><p class="src" + ><a id="v:foo" class="def" + >foo</a + > :: () <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><ul + ><li + ><p + >Unadorned:</p + ><ul + ><li + >Unqualified: <code + ><a href="#" title="GHC.List" + >++</a + ></code + >, <code + ><a href="#" title="Data.Foldable" + >elem</a + ></code + ></li + ><li + >Qualified: <code + ><a href="#" title="GHC.List" + >++</a + ></code + >, <code + ><a href="#" title="Data.Lis" + >elem</a + ></code + ></li + ><li + >Namespaced: <code + ><a href="#" title="GHC.List" + >++</a + ></code + >, <code + >++</code + >, <code + ><a href="#" title="Data.Foldable" + >elem</a + ></code + >, <code + >elem</code + >, <code + ><a href="#" title="Identifiers" + >Id</a + ></code + >, <code + ><a href="#" title="Identifiers" + >Id</a + ></code + >, <code + ><a href="#" title="Identifiers" + >:*</a + ></code + >, <code + ><a href="#" title="Identifiers" + >:*</a + ></code + ></li + ></ul + ></li + ><li + ><p + >Parenthesized:</p + ><ul + ><li + >Unqualified: <code + ><code + ><a href="#" title="GHC.List" + >(++)</a + ></code + > [1,2,3] [4,5,6]</code + ></li + ><li + >Qualified: <code + ><code + ><a href="#" title="GHC.List" + >(++)</a + ></code + > [1,2,3] [4,5,6]</code + ></li + ><li + >Namespaced: <code + ><a href="#" title="GHC.List" + >(++)</a + ></code + >, <code + >++</code + >, <code + ><a href="#" title="Identifiers" + >(:*)</a + ></code + >, <code + ><a href="#" title="Identifiers" + >(:*)</a + ></code + ></li + ></ul + ></li + ><li + ><p + >Backticked:</p + ><ul + ><li + >Unqualified: <code + >1 <code + ><a href="#" title="Data.Foldable" + >`elem`</a + ></code + > [-3..3]</code + ></li + ><li + >Qualified: <code + >1 <code + ><a href="#" title="Data.Foldable" + >`elem`</a + ></code + > [-3..3]</code + ></li + ><li + >Namespaced: <code + ><a href="#" title="Data.Foldable" + >`elem`</a + ></code + >, <code + >`elem`</code + >, <code + ><a href="#" title="Identifiers" + >`Id`</a + ></code + >, <code + ><a href="#" title="Identifiers" + >`Id`</a + ></code + ></li + ></ul + ></li + ><li + ><p + >Edge cases:</p + ><ul + ><li + >Tuples: <code + >()</code + >, <code + >(,,,)</code + ></li + ></ul + ></li + ></ul + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/IgnoreExports.html b/html-test/ref/IgnoreExports.html index eed12c00..ccaffdad 100644 --- a/html-test/ref/IgnoreExports.html +++ b/html-test/ref/IgnoreExports.html @@ -4,18 +4,20 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >IgnoreExports</title - ><link href="#" rel="stylesheet" type="text/css" title="Ocean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" ></script - ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" ></script ></head ><body ><div id="package-header" ><span class="caption empty" - ></span + > </span ><ul class="links" id="page-menu" ><li ><a href="#" @@ -34,7 +36,7 @@ ><th >Safe Haskell</th ><td - >Safe</td + >Safe-Inferred</td ></tr ></table ><p class="caption" @@ -46,15 +48,23 @@ >Synopsis</summary ><ul class="details-toggle" data-details-id="syn" ><li class="src short" + ><span class="keyword" + >data</span + > <a href="#" + >Foo</a + > = <a href="#" + >Bar</a + ></li + ><li class="src short" ><a href="#" >foo</a - > :: <a href="#" + > :: <a href="#" title="Data.Int" >Int</a ></li ><li class="src short" ><a href="#" >bar</a - > :: <a href="#" + > :: <a href="#" title="Data.Int" >Int</a ></li ></ul @@ -65,9 +75,39 @@ >Documentation</h1 ><div class="top" ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Foo" class="def" + >Foo</a + > <a href="#" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >documentation for Foo</p + ></div + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:Bar" class="def" + >Bar</a + ></td + ><td class="doc" + ><p + >Documentation for Bar</p + ></td + ></tr + ></table + ></div + ></div + ><div class="top" + ><p class="src" ><a id="v:foo" class="def" >foo</a - > :: <a href="#" + > :: <a href="#" title="Data.Int" >Int</a > <a href="#" class="selflink" >#</a @@ -81,7 +121,7 @@ ><p class="src" ><a id="v:bar" class="def" >bar</a - > :: <a href="#" + > :: <a href="#" title="Data.Int" >Int</a > <a href="#" class="selflink" >#</a @@ -93,8 +133,6 @@ ></div ></div ></div - ><div id="footer" - ></div ></body ></html > diff --git a/html-test/ref/ImplicitParams.html b/html-test/ref/ImplicitParams.html index 7f3ea4b5..1c0126a9 100644 --- a/html-test/ref/ImplicitParams.html +++ b/html-test/ref/ImplicitParams.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >ImplicitParams</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Instances.html b/html-test/ref/Instances.html index 83092456..4ed71a4b 100644 --- a/html-test/ref/Instances.html +++ b/html-test/ref/Instances.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Instances</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Math.html b/html-test/ref/Math.html index c2ce7b98..627f4840 100644 --- a/html-test/ref/Math.html +++ b/html-test/ref/Math.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Math</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Minimal.html b/html-test/ref/Minimal.html index 1ebfe955..cacbb86d 100644 --- a/html-test/ref/Minimal.html +++ b/html-test/ref/Minimal.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Minimal</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/ModuleWithWarning.html b/html-test/ref/ModuleWithWarning.html index d05fb042..cb8b8f27 100644 --- a/html-test/ref/ModuleWithWarning.html +++ b/html-test/ref/ModuleWithWarning.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >ModuleWithWarning</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/NamedDoc.html b/html-test/ref/NamedDoc.html index 08dcfdc7..1fd0c25b 100644 --- a/html-test/ref/NamedDoc.html +++ b/html-test/ref/NamedDoc.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >NamedDoc</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/NamespacedIdentifiers.html b/html-test/ref/NamespacedIdentifiers.html new file mode 100644 index 00000000..8424e46d --- /dev/null +++ b/html-test/ref/NamespacedIdentifiers.html @@ -0,0 +1,144 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" + /><meta name="viewport" content="width=device-width, initial-scale=1" + /><title + >NamespacedIdentifiers</title + ><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" + /><link rel="stylesheet" type="text/css" href="quick-jump.css" + /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" + /><script src="haddock-bundle.min.js" async="async" type="text/javascript" + ></script + ><script type="text/x-mathjax-config" + >MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script + ><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript" + ></script + ></head + ><body + ><div id="package-header" + ><span class="caption empty" + > </span + ><ul class="links" id="page-menu" + ><li + ><a href="index.html" + >Contents</a + ></li + ><li + ><a href="doc-index.html" + >Index</a + ></li + ></ul + ></div + ><div id="content" + ><div id="module-header" + ><table class="info" + ><tr + ><th + >Safe Haskell</th + ><td + >Safe-Inferred</td + ></tr + ></table + ><p class="caption" + >NamespacedIdentifiers</p + ></div + ><div id="synopsis" + ><details id="syn" + ><summary + >Synopsis</summary + ><ul class="details-toggle" data-details-id="syn" + ><li class="src short" + ><span class="keyword" + >data</span + > <a href="#t:Foo" + >Foo</a + > = <a href="#v:Bar" + >Bar</a + ></li + ><li class="src short" + ><span class="keyword" + >data</span + > <a href="#t:Bar" + >Bar</a + ></li + ></ul + ></details + ></div + ><div id="interface" + ><h1 + >Documentation</h1 + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Foo" class="def" + >Foo</a + > <a href="#t:Foo" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >A link to:</p + ><ul + ><li + >the type <code + ><a href="NamespacedIdentifiers.html#t:Bar" title="NamespacedIdentifiers" + >Bar</a + ></code + ></li + ><li + >the constructor <code + ><a href="NamespacedIdentifiers.html#v:Bar" title="NamespacedIdentifiers" + >Bar</a + ></code + ></li + ><li + >the unimported but qualified type <code + ><a href="A.html#t:A" title="A" + >A</a + ></code + ></li + ><li + >the unimported but qualified value <code + ><a href="A.html#v:A" title="A" + >A</a + ></code + ></li + ></ul + ></div + ><div class="subs constructors" + ><p class="caption" + >Constructors</p + ><table + ><tr + ><td class="src" + ><a id="v:Bar" class="def" + >Bar</a + ></td + ><td class="doc empty" + > </td + ></tr + ></table + ></div + ></div + ><div class="top" + ><p class="src" + ><span class="keyword" + >data</span + > <a id="t:Bar" class="def" + >Bar</a + > <a href="#t:Bar" class="selflink" + >#</a + ></p + ><div class="doc" + ><p + >A link to the value <code + >Foo</code + > (which shouldn't exist).</p + ></div + ></div + ></div + ></div + ></body + ></html +> diff --git a/html-test/ref/Nesting.html b/html-test/ref/Nesting.html index 14556c42..14905718 100644 --- a/html-test/ref/Nesting.html +++ b/html-test/ref/Nesting.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Nesting</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/NoLayout.html b/html-test/ref/NoLayout.html index a546787f..a6afc3fc 100644 --- a/html-test/ref/NoLayout.html +++ b/html-test/ref/NoLayout.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >NoLayout</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/NonGreedy.html b/html-test/ref/NonGreedy.html index cfa8ea5b..76861de6 100644 --- a/html-test/ref/NonGreedy.html +++ b/html-test/ref/NonGreedy.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >NonGreedy</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Operators.html b/html-test/ref/Operators.html index 7272eb83..005d3a0c 100644 --- a/html-test/ref/Operators.html +++ b/html-test/ref/Operators.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Operators</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/OrphanInstances.html b/html-test/ref/OrphanInstances.html index de52a503..cc5b5c7c 100644 --- a/html-test/ref/OrphanInstances.html +++ b/html-test/ref/OrphanInstances.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >OrphanInstances</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/OrphanInstancesClass.html b/html-test/ref/OrphanInstancesClass.html index 6531abe5..b90e36e2 100644 --- a/html-test/ref/OrphanInstancesClass.html +++ b/html-test/ref/OrphanInstancesClass.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >OrphanInstancesClass</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/OrphanInstancesType.html b/html-test/ref/OrphanInstancesType.html index f54f5b9e..16ea1d53 100644 --- a/html-test/ref/OrphanInstancesType.html +++ b/html-test/ref/OrphanInstancesType.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >OrphanInstancesType</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/PR643.html b/html-test/ref/PR643.html index c331608d..e19e3343 100644 --- a/html-test/ref/PR643.html +++ b/html-test/ref/PR643.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >PR643</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/PR643_1.html b/html-test/ref/PR643_1.html index ac18fed1..0582deae 100644 --- a/html-test/ref/PR643_1.html +++ b/html-test/ref/PR643_1.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >PR643_1</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/PatternSyns.html b/html-test/ref/PatternSyns.html index 23c734f4..7e5cdc1f 100644 --- a/html-test/ref/PatternSyns.html +++ b/html-test/ref/PatternSyns.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >PatternSyns</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" @@ -98,9 +98,11 @@ >data</span > <a href="#" >BlubType</a - > = <a href="#" title="Text.Show" + > = <span class="keyword" + >forall</span + > x.<a href="#" title="Text.Show" >Show</a - > x => <a href="#" + > x => <a href="#" >BlubCtor</a > x</li ><li class="src short" @@ -258,9 +260,11 @@ ><table ><tr ><td class="src" - ><a href="#" title="Text.Show" + ><span class="keyword" + >forall</span + > x.<a href="#" title="Text.Show" >Show</a - > x => <a id="v:BlubCtor" class="def" + > x => <a id="v:BlubCtor" class="def" >BlubCtor</a > x</td ><td class="doc empty" diff --git a/html-test/ref/PromotedTypes.html b/html-test/ref/PromotedTypes.html index 643cea35..b4e4dd7c 100644 --- a/html-test/ref/PromotedTypes.html +++ b/html-test/ref/PromotedTypes.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >PromotedTypes</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Properties.html b/html-test/ref/Properties.html index 8dbf7bec..2adab2b0 100644 --- a/html-test/ref/Properties.html +++ b/html-test/ref/Properties.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Properties</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/PruneWithWarning.html b/html-test/ref/PruneWithWarning.html index 18760d56..9747a87f 100644 --- a/html-test/ref/PruneWithWarning.html +++ b/html-test/ref/PruneWithWarning.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >PruneWithWarning</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/QuantifiedConstraints.html b/html-test/ref/QuantifiedConstraints.html index be778aee..0833f1a8 100644 --- a/html-test/ref/QuantifiedConstraints.html +++ b/html-test/ref/QuantifiedConstraints.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >QuantifiedConstraints</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/QuasiExpr.html b/html-test/ref/QuasiExpr.html index f719d067..2eb2cda3 100644 --- a/html-test/ref/QuasiExpr.html +++ b/html-test/ref/QuasiExpr.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >QuasiExpr</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/QuasiQuote.html b/html-test/ref/QuasiQuote.html index edf14f4e..d828ea1d 100644 --- a/html-test/ref/QuasiQuote.html +++ b/html-test/ref/QuasiQuote.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >QuasiQuote</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/SpuriousSuperclassConstraints.html b/html-test/ref/SpuriousSuperclassConstraints.html index 189f3cc1..7293a149 100644 --- a/html-test/ref/SpuriousSuperclassConstraints.html +++ b/html-test/ref/SpuriousSuperclassConstraints.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >SpuriousSuperclassConstraints</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/TH.html b/html-test/ref/TH.html index c8a7a6a3..8ef49ced 100644 --- a/html-test/ref/TH.html +++ b/html-test/ref/TH.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >TH</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/TH2.html b/html-test/ref/TH2.html index 4a69bd01..f59629a2 100644 --- a/html-test/ref/TH2.html +++ b/html-test/ref/TH2.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >TH2</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Table.html b/html-test/ref/Table.html index 0905b0ee..8a299018 100644 --- a/html-test/ref/Table.html +++ b/html-test/ref/Table.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Table</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Test.html b/html-test/ref/Test.html index 0503e544..ce2acb60 100644 --- a/html-test/ref/Test.html +++ b/html-test/ref/Test.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Test</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" @@ -579,19 +579,25 @@ >Ex</a > a<ul class="subs" ><li - >= <a href="#" title="Test" + >= <span class="keyword" + >forall</span + > b.<a href="#" title="Test" >C</a - > b => <a href="#" + > b => <a href="#" >Ex1</a > b</li ><li - >| <a href="#" + >| <span class="keyword" + >forall</span + > b. <a href="#" >Ex2</a > b</li ><li - >| <a href="#" title="Test" + >| <span class="keyword" + >forall</span + > b.<a href="#" title="Test" >C</a - > a => <a href="#" + > a => <a href="#" >Ex3</a > b</li ><li @@ -2069,9 +2075,11 @@ is at the beginning of the line).</pre ><table ><tr ><td class="src" - ><a href="#" title="Test" + ><span class="keyword" + >forall</span + > b.<a href="#" title="Test" >C</a - > b => <a id="v:Ex1" class="def" + > b => <a id="v:Ex1" class="def" >Ex1</a > b</td ><td class="doc empty" @@ -2079,7 +2087,9 @@ is at the beginning of the line).</pre ></tr ><tr ><td class="src" - ><a id="v:Ex2" class="def" + ><span class="keyword" + >forall</span + > b. <a id="v:Ex2" class="def" >Ex2</a > b</td ><td class="doc empty" @@ -2087,9 +2097,11 @@ is at the beginning of the line).</pre ></tr ><tr ><td class="src" - ><a href="#" title="Test" + ><span class="keyword" + >forall</span + > b.<a href="#" title="Test" >C</a - > a => <a id="v:Ex3" class="def" + > a => <a id="v:Ex3" class="def" >Ex3</a > b</td ><td class="doc empty" @@ -2364,7 +2376,7 @@ is at the beginning of the line).</pre >f'</a ></code > - but f' doesn't get link'd 'f\''</p + but f' doesn't get link'd 'f''</p ></div ></div ><div class="top" diff --git a/html-test/ref/Threaded.html b/html-test/ref/Threaded.html index 96a4f060..3277c468 100644 --- a/html-test/ref/Threaded.html +++ b/html-test/ref/Threaded.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Threaded</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Threaded_TH.html b/html-test/ref/Threaded_TH.html index 7d43c741..8850eafb 100644 --- a/html-test/ref/Threaded_TH.html +++ b/html-test/ref/Threaded_TH.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Threaded_TH</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Ticket112.html b/html-test/ref/Ticket112.html index 4da5c459..9d04e8c5 100644 --- a/html-test/ref/Ticket112.html +++ b/html-test/ref/Ticket112.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Ticket112</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Ticket61.html b/html-test/ref/Ticket61.html index 8f2774f2..5e384b86 100644 --- a/html-test/ref/Ticket61.html +++ b/html-test/ref/Ticket61.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Ticket61</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Ticket75.html b/html-test/ref/Ticket75.html index 8fb039e1..4940b6fb 100644 --- a/html-test/ref/Ticket75.html +++ b/html-test/ref/Ticket75.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Ticket75</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/TitledPicture.html b/html-test/ref/TitledPicture.html index 0dde024f..5b936a16 100644 --- a/html-test/ref/TitledPicture.html +++ b/html-test/ref/TitledPicture.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >TitledPicture</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/TypeFamilies.html b/html-test/ref/TypeFamilies.html index 15eed97d..998b6d8c 100644 --- a/html-test/ref/TypeFamilies.html +++ b/html-test/ref/TypeFamilies.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >TypeFamilies</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" @@ -493,13 +493,13 @@ >AssocT</a > <a href="#" title="TypeFamilies" >X</a - > = (<a href="#" title="TypeFamilies" + > = <a href="#" title="TypeFamilies" >Foo</a > <a href="#" title="TypeFamilies" >X</a > :: <a href="#" title="Data.Kind" >Type</a - >)</div + ></div ></details ></td ></tr diff --git a/html-test/ref/TypeFamilies2.html b/html-test/ref/TypeFamilies2.html index 7590033b..8425a1d4 100644 --- a/html-test/ref/TypeFamilies2.html +++ b/html-test/ref/TypeFamilies2.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >TypeFamilies2</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/TypeFamilies3.html b/html-test/ref/TypeFamilies3.html index e07e3981..88e74dd9 100644 --- a/html-test/ref/TypeFamilies3.html +++ b/html-test/ref/TypeFamilies3.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >TypeFamilies3</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/TypeOperators.html b/html-test/ref/TypeOperators.html index f12f250a..5588e82a 100644 --- a/html-test/ref/TypeOperators.html +++ b/html-test/ref/TypeOperators.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >TypeOperators</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/UnboxedStuff.html b/html-test/ref/UnboxedStuff.html index 99000137..0f7ae983 100644 --- a/html-test/ref/UnboxedStuff.html +++ b/html-test/ref/UnboxedStuff.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >UnboxedStuff</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Unicode.html b/html-test/ref/Unicode.html index 1956394a..8f301458 100644 --- a/html-test/ref/Unicode.html +++ b/html-test/ref/Unicode.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Unicode</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Unicode2.html b/html-test/ref/Unicode2.html index 808762d8..b789c2d7 100644 --- a/html-test/ref/Unicode2.html +++ b/html-test/ref/Unicode2.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Unicode2</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/ref/Visible.html b/html-test/ref/Visible.html index 81f2a837..0a932038 100644 --- a/html-test/ref/Visible.html +++ b/html-test/ref/Visible.html @@ -4,7 +4,7 @@ /><meta name="viewport" content="width=device-width, initial-scale=1" /><title >Visible</title - ><link href="#" rel="stylesheet" type="text/css" title="NewOcean" + ><link href="#" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="#" /><link rel="stylesheet" type="text/css" href="#" /><script src="haddock-bundle.min.js" async="async" type="text/javascript" diff --git a/html-test/src/Bug1004.hs b/html-test/src/Bug1004.hs new file mode 100644 index 00000000..d789e77f --- /dev/null +++ b/html-test/src/Bug1004.hs @@ -0,0 +1,3 @@ +module Bug1004 (Product(..)) where + +import Data.Functor.Product diff --git a/html-test/src/Bug1033.hs b/html-test/src/Bug1033.hs new file mode 100644 index 00000000..fdf5a57e --- /dev/null +++ b/html-test/src/Bug1033.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE StandaloneDeriving #-} + +module Bug1033 where + +import GHC.Generics + +data Foo = Foo + +-- | This does some generic foos. +deriving instance Generic Foo diff --git a/html-test/src/Bug1035.hs b/html-test/src/Bug1035.hs new file mode 100644 index 00000000..3516c08f --- /dev/null +++ b/html-test/src/Bug1035.hs @@ -0,0 +1,9 @@ +module Bug1035 where + +data Foo = Bar + +data Bar = Foo + +-- | A link to 'Bar' +foo :: () +foo = () diff --git a/html-test/src/Bug1063.hs b/html-test/src/Bug1063.hs new file mode 100644 index 00000000..c6d13a1f --- /dev/null +++ b/html-test/src/Bug1063.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE UndecidableInstances #-} +module Bug1063 where + +class (c => d) => Implies c d +instance (c => d) => Implies c d diff --git a/html-test/src/Bug1103.hs b/html-test/src/Bug1103.hs new file mode 100644 index 00000000..1f387e62 --- /dev/null +++ b/html-test/src/Bug1103.hs @@ -0,0 +1,24 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +module Bug1103 where + +import Data.Kind + +data family Foo1 :: Type -> Type +data instance Foo1 Bool = Foo1Bool +data instance Foo1 (Maybe a) + +data family Foo2 :: k -> Type +data instance Foo2 Bool = Foo2Bool +data instance Foo2 (Maybe a) +data instance Foo2 :: Char -> Type +data instance Foo2 :: (Char -> Char) -> Type where + +data family Foo3 :: k +data instance Foo3 +data instance Foo3 Bool = Foo3Bool +data instance Foo3 (Maybe a) +data instance Foo3 :: Char -> Type +data instance Foo3 :: (Char -> Char) -> Type where diff --git a/html-test/src/Bug466.hs b/html-test/src/Bug466.hs new file mode 100644 index 00000000..ec7cde2c --- /dev/null +++ b/html-test/src/Bug466.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds, TypeFamilies, StarIsType #-} +module Bug466 where + +class Cl a where + type Fam a :: [*] + +data X = X +instance Cl X where + type Fam X = '[Char] diff --git a/html-test/src/Bug975.hs b/html-test/src/Bug975.hs new file mode 100644 index 00000000..97ebabda --- /dev/null +++ b/html-test/src/Bug975.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE ExplicitForAll #-} +module Bug973 where + +showRead + :: forall a b. (Show a, Read b) + => a -- ^ this gets turned into a string... + -> b -- ^ ...from which this is read +showRead = read . show + +-- | Same as 'showRead', but with type variable order flipped +showRead' + :: forall b a. (Show a, Read b) + => a -- ^ this gets turned into a string... + -> b -- ^ ...from which this is read +showRead' = read . show diff --git a/html-test/src/DefaultAssociatedTypes.hs b/html-test/src/DefaultAssociatedTypes.hs new file mode 100644 index 00000000..6ad197d3 --- /dev/null +++ b/html-test/src/DefaultAssociatedTypes.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE DefaultSignatures, TypeFamilies #-} + +module DefaultAssociatedTypes where + +-- | Documentation for Foo. +class Foo a where + -- | Documentation for bar and baz. + bar, baz :: a -> String + + -- | Doc for Qux + type Qux a :: * + + -- | Doc for default Qux + type Qux a = [a] diff --git a/html-test/src/DefaultSignatures.hs b/html-test/src/DefaultSignatures.hs new file mode 100644 index 00000000..52d68a96 --- /dev/null +++ b/html-test/src/DefaultSignatures.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE DefaultSignatures #-} + +module DefaultSignatures where + +-- | Documentation for Foo. +class Foo a where + -- | Documentation for bar and baz. + bar, baz :: a -> String + + -- | Documentation for the default signature of bar. + default bar :: Show a => a -> String + bar = show + + -- | Documentation for baz'. + baz' :: String -> a + + -- | Documentation for the default signature of baz'. + default baz' :: Read a => String -> a + baz' = read diff --git a/html-test/src/Identifiers.hs b/html-test/src/Identifiers.hs new file mode 100644 index 00000000..75f12109 --- /dev/null +++ b/html-test/src/Identifiers.hs @@ -0,0 +1,35 @@ +{-# LANGUAGE TypeOperators #-} +module Identifiers where + +import Data.List (elem, (++)) + +data Id = Id +data a :* b = a :* b + +{-| + + * Unadorned: + + - Unqualified: '++', 'elem' + - Qualified: 'Data.List.++', 'Data.Lis.elem' + - Namespaced: v'++', t'++', v'elem', t'elem', v'Id', t'Id', v':*', t':*' + + * Parenthesized: + + - Unqualified: @'(++)' [1,2,3] [4,5,6]@ + - Qualified: @'(Data.List.++)' [1,2,3] [4,5,6]@ + - Namespaced: v'(++)', t'++', v'(:*)', t'(:*)' + + * Backticked: + + - Unqualified: @1 '`elem`' [-3..3]@ + - Qualified: @1 '`Data.List.elem`' [-3..3]@ + - Namespaced: v'`elem`', t'`elem`', v'`Id`', t'`Id`' + + * Edge cases: + + - Tuples: '()', '(,,,)' + +-} +foo :: () +foo = () diff --git a/html-test/src/IgnoreExports.hs b/html-test/src/IgnoreExports.hs index 0321ad02..edb7c4c1 100644 --- a/html-test/src/IgnoreExports.hs +++ b/html-test/src/IgnoreExports.hs @@ -1,5 +1,8 @@ {-# OPTIONS_HADDOCK ignore-exports #-} -module IgnoreExports (foo) where +module IgnoreExports (Foo, foo) where + +-- | documentation for Foo +data Foo = Bar -- ^ Documentation for Bar -- | documentation for foo foo :: Int diff --git a/html-test/src/NamespacedIdentifiers.hs b/html-test/src/NamespacedIdentifiers.hs new file mode 100644 index 00000000..6f59d247 --- /dev/null +++ b/html-test/src/NamespacedIdentifiers.hs @@ -0,0 +1,13 @@ +module NamespacedIdentifiers where + +-- | A link to: +-- +-- * the type t'Bar' +-- * the constructor v'Bar' +-- * the unimported but qualified type t'A.A' +-- * the unimported but qualified value v'A.A' +-- +data Foo = Bar + +-- | A link to the value v'Foo' (which shouldn't exist). +data Bar diff --git a/hypsrc-test/ref/src/Bug1091.html b/hypsrc-test/ref/src/Bug1091.html new file mode 100644 index 00000000..a9c7d163 --- /dev/null +++ b/hypsrc-test/ref/src/Bug1091.html @@ -0,0 +1,34 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-pragma" + >{-# LANGUAGE CPP #-}</span + ><span + > +</span + ><span id="line-2" + ></span + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Bug1091</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span class="hs-cpp" + > + +#include "Include1For1091.h" +</span + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/CallingQuotes.html b/hypsrc-test/ref/src/CallingQuotes.html new file mode 100644 index 00000000..9b2e3209 --- /dev/null +++ b/hypsrc-test/ref/src/CallingQuotes.html @@ -0,0 +1,104 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-pragma" + >{-# LANGUAGE QuasiQuotes #-}</span + ><span + > +</span + ><span id="line-2" + ></span + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >CallingQuotes</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><span id="line-3" + ></span + ><span + > +</span + ><span id="line-4" + ></span + ><span class="hs-keyword" + >import</span + ><span + > </span + ><span class="annot" + ><a href="Quasiquoter.html" + ><span class="hs-identifier" + >Quasiquoter</span + ></a + ></span + ><span + > +</span + ><span id="line-5" + ></span + ><span + > +</span + ><span id="line-6" + ></span + ><span id="baz" + ><span class="annot" + ><span class="annottext" + >baz :: [Char] +</span + ><a href="CallingQuotes.html#baz" + ><span class="hs-identifier hs-var hs-var" + >baz</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="" + >[string| foo bar |]</span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >[Char] -> [Char] -> [Char] +forall a. [a] -> [a] -> [a] +</span + ><span class="hs-operator hs-var" + >++</span + ></span + ><span + > </span + ><span class="annot" + ><span class="" + >[string| some + mulitline + quasiquote +|]</span + ></span + ><span + > +</span + ><span id="line-10" + ></span + ></pre + ></body + ></html +>
\ No newline at end of file diff --git a/hypsrc-test/ref/src/Quasiquoter.html b/hypsrc-test/ref/src/Quasiquoter.html new file mode 100644 index 00000000..f53219d7 --- /dev/null +++ b/hypsrc-test/ref/src/Quasiquoter.html @@ -0,0 +1,423 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >Quasiquoter</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span + > </span + ><span class="annot" + ><a href="Quasiquoter.html#string" + ><span class="hs-identifier" + >string</span + ></a + ></span + ><span + > </span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><span id="line-2" + ></span + ><span + > +</span + ><span id="line-3" + ></span + ><span class="hs-keyword" + >import</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier" + >Language.Haskell.TH.Quote</span + ></span + ><span + > +</span + ><span id="line-4" + ></span + ><span class="hs-keyword" + >import</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier" + >Language.Haskell.TH.Syntax</span + ></span + ><span + > +</span + ><span id="line-5" + ></span + ><span + > +</span + ><span id="line-6" + ></span + ><span class="hs-comment" + >-- | Quoter for constructing multiline string literals</span + ><span + > +</span + ><span id="line-7" + ></span + ><span class="annot" + ><a href="Quasiquoter.html#string" + ><span class="hs-identifier hs-type" + >string</span + ></a + ></span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >QuasiQuoter</span + ></span + ><span + > +</span + ><span id="line-8" + ></span + ><span id="string" + ><span class="annot" + ><span class="annottext" + >string :: QuasiQuoter +</span + ><a href="Quasiquoter.html#string" + ><span class="hs-identifier hs-var hs-var" + >string</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >QuasiQuoter :: (String -> Q Exp) +-> (String -> Q Pat) +-> (String -> Q Type) +-> (String -> Q [Dec]) +-> QuasiQuoter +</span + ><span class="hs-identifier hs-type" + >QuasiQuoter</span + ></span + ><span + > +</span + ><span id="line-9" + ></span + ><span + > </span + ><span class="hs-special" + >{</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >quoteExp :: String -> Q Exp +</span + ><span class="hs-identifier hs-var" + >quoteExp</span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >Exp -> Q Exp +forall (f :: * -> *) a. Applicative f => a -> f a +</span + ><span class="hs-identifier hs-var" + >pure</span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >(Exp -> Q Exp) -> (String -> Exp) -> String -> Q Exp +forall b c a. (b -> c) -> (a -> b) -> a -> c +</span + ><span class="hs-operator hs-var" + >.</span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >Lit -> Exp +</span + ><span class="hs-identifier hs-var" + >LitE</span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >(Lit -> Exp) -> (String -> Lit) -> String -> Exp +forall b c a. (b -> c) -> (a -> b) -> a -> c +</span + ><span class="hs-operator hs-var" + >.</span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >String -> Lit +</span + ><span class="hs-identifier hs-var" + >StringL</span + ></span + ><span + > +</span + ><span id="line-10" + ></span + ><span + > </span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >quotePat :: String -> Q Pat +</span + ><span class="hs-identifier hs-var" + >quotePat</span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >String -> Q Pat +forall a. String -> Q a +</span + ><a href="#" + ><span class="hs-identifier hs-var" + >invalidDomain</span + ></a + ></span + ><span + > +</span + ><span id="line-11" + ></span + ><span + > </span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >quoteType :: String -> Q Type +</span + ><span class="hs-identifier hs-var" + >quoteType</span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >String -> Q Type +forall a. String -> Q a +</span + ><a href="#" + ><span class="hs-identifier hs-var" + >invalidDomain</span + ></a + ></span + ><span + > +</span + ><span id="line-12" + ></span + ><span + > </span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >quoteDec :: String -> Q [Dec] +</span + ><span class="hs-identifier hs-var" + >quoteDec</span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >String -> Q [Dec] +forall a. String -> Q a +</span + ><a href="#" + ><span class="hs-identifier hs-var" + >invalidDomain</span + ></a + ></span + ><span + > +</span + ><span id="line-13" + ></span + ><span + > </span + ><span class="hs-special" + >}</span + ><span + > +</span + ><span id="line-14" + ></span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><span id="line-15" + ></span + ><span + > </span + ><span id="" + ><span class="annot" + ><a href="#" + ><span class="hs-identifier hs-type" + >invalidDomain</span + ></a + ></span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >String</span + ></span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >Q</span + ></span + ><span + > </span + ><span class="annot" + ><a href="#" + ><span class="hs-identifier hs-type" + >a</span + ></a + ></span + ></span + ><span + > +</span + ><span id="line-16" + ></span + ><span + > </span + ><span id="" + ><span class="annot" + ><span class="annottext" + >invalidDomain :: String -> Q a +</span + ><a href="#" + ><span class="hs-identifier hs-var hs-var" + >invalidDomain</span + ></a + ></span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >String +</span + ><span class="hs-identifier" + >_</span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >String -> Q a +forall (m :: * -> *) a. MonadFail m => String -> m a +</span + ><span class="hs-identifier hs-var" + >fail</span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >String +</span + ><span class="hs-string" + >"stringQuoter: only valid in expression context"</span + ></span + ><span + > +</span + ><span id="line-17" + ></span + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/TemplateHaskellQuasiquotes.html b/hypsrc-test/ref/src/TemplateHaskellQuasiquotes.html new file mode 100644 index 00000000..68c7b754 --- /dev/null +++ b/hypsrc-test/ref/src/TemplateHaskellQuasiquotes.html @@ -0,0 +1,659 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-pragma" + >{-# LANGUAGE TemplateHaskell #-}</span + ><span + > +</span + ><span id="line-2" + ></span + ><span + > +</span + ><span id="line-3" + ></span + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >TemplateHaskellQuasiquotes</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><span id="line-4" + ></span + ><span + > +</span + ><span id="line-5" + ></span + ><span class="hs-keyword" + >import</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier" + >Language.Haskell.TH</span + ></span + ><span + > +</span + ><span id="line-6" + ></span + ><span + > +</span + ><span id="line-7" + ></span + ><span class="annot" + ><a href="TemplateHaskellQuasiquotes.html#aDecl" + ><span class="hs-identifier hs-type" + >aDecl</span + ></a + ></span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >DecsQ</span + ></span + ><span + > +</span + ><span id="line-8" + ></span + ><span id="aDecl" + ><span class="annot" + ><span class="annottext" + >aDecl :: DecsQ +</span + ><a href="TemplateHaskellQuasiquotes.html#aDecl" + ><span class="hs-identifier hs-var hs-var" + >aDecl</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >[d|</span + ><span + > +</span + ><span id="line-9" + ></span + ><span + > </span + ><span class="hs-identifier" + >bar</span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="" + >$aType</span + ><span + > </span + ><span class="hs-glyph" + >-></span + ><span + > </span + ><span class="hs-special" + >[</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier" + >Int</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >String</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >]</span + ><span + > +</span + ><span id="line-10" + ></span + ><span + > </span + ><span class="hs-identifier" + >bar</span + ><span + > </span + ><span class="" + >$aPattern</span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="" + >$anExpression</span + ><span + > +</span + ><span id="line-11" + ></span + ><span + > </span + ><span class="hs-special" + >|]</span + ><span + > +</span + ><span id="line-12" + ></span + ><span + > +</span + ><span id="line-13" + ></span + ><span class="annot" + ><a href="TemplateHaskellQuasiquotes.html#aPattern" + ><span class="hs-identifier hs-type" + >aPattern</span + ></a + ></span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >PatQ</span + ></span + ><span + > +</span + ><span id="line-14" + ></span + ><span id="aPattern" + ><span class="annot" + ><span class="annottext" + >aPattern :: PatQ +</span + ><a href="TemplateHaskellQuasiquotes.html#aPattern" + ><span class="hs-identifier hs-var hs-var" + >aPattern</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >[p|</span + ><span + > +</span + ><span id="line-15" + ></span + ><span + > </span + ><span class="hs-special" + >[</span + ><span + > </span + ><span class="hs-identifier" + >aCrazyLongVariableName</span + ><span + > +</span + ><span id="line-16" + ></span + ><span + > </span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >_unused</span + ><span + > +</span + ><span id="line-17" + ></span + ><span + > </span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier" + >y</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >z</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><span id="line-18" + ></span + ><span + > </span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span + > </span + ><span class="" + >$aNumberPattern</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-string" + >"hello"</span + ><span class="hs-special" + >)</span + ><span + > +</span + ><span id="line-19" + ></span + ><span + > </span + ><span class="hs-special" + >]</span + ><span + > +</span + ><span id="line-20" + ></span + ><span + > </span + ><span class="hs-special" + >|]</span + ><span + > +</span + ><span id="line-21" + ></span + ><span + > +</span + ><span id="line-22" + ></span + ><span class="annot" + ><a href="TemplateHaskellQuasiquotes.html#aNumberPattern" + ><span class="hs-identifier hs-type" + >aNumberPattern</span + ></a + ></span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >PatQ</span + ></span + ><span + > +</span + ><span id="line-23" + ></span + ><span id="aNumberPattern" + ><span class="annot" + ><span class="annottext" + >aNumberPattern :: PatQ +</span + ><a href="TemplateHaskellQuasiquotes.html#aNumberPattern" + ><span class="hs-identifier hs-var hs-var" + >aNumberPattern</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >[p|</span + ><span + > +</span + ><span id="line-24" + ></span + ><span + > </span + ><span class="hs-identifier" + >w</span + ><span + > </span + ><span class="hs-glyph" + >@</span + ><span + > </span + ><span class="hs-identifier" + >v</span + ><span + > </span + ><span class="hs-glyph" + >@</span + ><span + > </span + ><span class="hs-number" + >4.5</span + ><span + > +</span + ><span id="line-25" + ></span + ><span + > </span + ><span class="hs-special" + >|]</span + ><span + > +</span + ><span id="line-26" + ></span + ><span + > +</span + ><span id="line-27" + ></span + ><span class="annot" + ><a href="TemplateHaskellQuasiquotes.html#anExpression" + ><span class="hs-identifier hs-type" + >anExpression</span + ></a + ></span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="annot" + ><a href="TemplateHaskellQuasiquotes.html#anExpression2" + ><span class="hs-identifier hs-type" + >anExpression2</span + ></a + ></span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >ExpQ</span + ></span + ><span + > +</span + ><span id="line-28" + ></span + ><span id="anExpression" + ><span class="annot" + ><span class="annottext" + >anExpression :: ExpQ +</span + ><a href="TemplateHaskellQuasiquotes.html#anExpression" + ><span class="hs-identifier hs-var hs-var" + >anExpression</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >[e|</span + ><span + > +</span + ><span id="line-29" + ></span + ><span + > </span + ><span class="hs-special" + >[</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-number" + >1</span + ><span + > </span + ><span class="hs-operator" + >+</span + ><span + > </span + ><span class="" + >$anExpression2</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-string" + >"world"</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >]</span + ><span + > +</span + ><span id="line-30" + ></span + ><span + > </span + ><span class="hs-special" + >|]</span + ><span + > +</span + ><span id="line-31" + ></span + ><span id="anExpression2" + ><span class="annot" + ><span class="annottext" + >anExpression2 :: ExpQ +</span + ><a href="TemplateHaskellQuasiquotes.html#anExpression2" + ><span class="hs-identifier hs-var hs-var" + >anExpression2</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >[|</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-number" + >1</span + ><span + > </span + ><span class="hs-operator" + >+</span + ><span + > </span + ><span class="hs-identifier" + >round</span + ><span + > </span + ><span class="hs-identifier" + >pi</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >|]</span + ><span + > +</span + ><span id="line-32" + ></span + ><span + > +</span + ><span id="line-33" + ></span + ><span class="annot" + ><a href="TemplateHaskellQuasiquotes.html#aType" + ><span class="hs-identifier hs-type" + >aType</span + ></a + ></span + ><span + > </span + ><span class="hs-glyph" + >::</span + ><span + > </span + ><span class="annot" + ><span class="hs-identifier hs-type" + >TypeQ</span + ></span + ><span + > +</span + ><span id="line-34" + ></span + ><span id="aType" + ><span class="annot" + ><span class="annottext" + >aType :: TypeQ +</span + ><a href="TemplateHaskellQuasiquotes.html#aType" + ><span class="hs-identifier hs-var hs-var" + >aType</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="hs-special" + >[t|</span + ><span + > +</span + ><span id="line-35" + ></span + ><span + > </span + ><span class="hs-special" + >[</span + ><span + > </span + ><span class="hs-special" + >(</span + ><span class="hs-identifier" + >Double</span + ><span class="hs-special" + >,</span + ><span + > </span + ><span class="hs-identifier" + >String</span + ><span class="hs-special" + >)</span + ><span + > </span + ><span class="hs-special" + >]</span + ><span + > +</span + ><span id="line-36" + ></span + ><span + > </span + ><span class="hs-special" + >|]</span + ><span + > +</span + ><span id="line-37" + ></span + ><span + > +</span + ><span id="line-38" + ></span + ><span + > +</span + ><span id="line-39" + ></span + ><span + > +</span + ><span id="line-40" + ></span + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/TemplateHaskellSplices.html b/hypsrc-test/ref/src/TemplateHaskellSplices.html new file mode 100644 index 00000000..6586d299 --- /dev/null +++ b/hypsrc-test/ref/src/TemplateHaskellSplices.html @@ -0,0 +1,136 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-pragma" + >{-# LANGUAGE TemplateHaskell #-}</span + ><span + > +</span + ><span id="line-2" + ></span + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >TemplateHaskellSplices</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><span id="line-3" + ></span + ><span + > +</span + ><span id="line-4" + ></span + ><span class="hs-keyword" + >import</span + ><span + > </span + ><span class="annot" + ><a href="TemplateHaskellQuasiquotes.html" + ><span class="hs-identifier" + >TemplateHaskellQuasiquotes</span + ></a + ></span + ><span + > +</span + ><span id="line-5" + ></span + ><span + > +</span + ><span id="line-6" + ></span + ><span class="hs-special" + >$(</span + ><span id="bar" + ><span class="annot" + ><span class="annottext" + >[(Double, String)] -> [(Int, String)] +</span + ><a href="TemplateHaskellSplices.html#bar" + ><span class="hs-identifier hs-type hs-var" + >aDecl</span + ></a + ></span + ></span + ><span class="hs-special" + >)</span + ><span + > +</span + ><span id="line-7" + ></span + ><span + > +</span + ><span id="line-8" + ></span + ><span id="foo" + ><span class="annot" + ><span class="annottext" + >foo :: Integer +</span + ><a href="TemplateHaskellSplices.html#foo" + ><span class="hs-identifier hs-var hs-var" + >foo</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >Integer -> Integer +forall a. a -> a +</span + ><span class="hs-identifier hs-var" + >id</span + ></span + ><span + > </span + ><span class="hs-special" + >$(</span + ><span class="annot" + ><span class="annottext" + >Double +Integer +Double -> Integer +Integer -> Integer -> Integer +forall a. Floating a => a +forall a. Num a => a -> a -> a +forall a b. (RealFrac a, Integral b) => a -> b ++ :: forall a. Num a => a -> a -> a +round :: forall a b. (RealFrac a, Integral b) => a -> b +pi :: forall a. Floating a => a +</span + ><span class="hs-identifier hs-var hs-var hs-var" + >anExpression2</span + ></span + ><span class="hs-special" + >)</span + ><span + > +</span + ><span id="line-9" + ></span + ></pre + ></body + ></html +> diff --git a/hypsrc-test/ref/src/UsingQuasiquotes.html b/hypsrc-test/ref/src/UsingQuasiquotes.html new file mode 100644 index 00000000..ca48775d --- /dev/null +++ b/hypsrc-test/ref/src/UsingQuasiquotes.html @@ -0,0 +1,104 @@ +<html xmlns="http://www.w3.org/1999/xhtml" +><head + ><link rel="stylesheet" type="text/css" href="style.css" + /><script type="text/javascript" src="highlight.js" + ></script + ></head + ><body + ><pre + ><span class="hs-pragma" + >{-# LANGUAGE QuasiQuotes #-}</span + ><span + > +</span + ><span id="line-2" + ></span + ><span class="hs-keyword" + >module</span + ><span + > </span + ><span class="hs-identifier" + >UsingQuasiquotes</span + ><span + > </span + ><span class="hs-keyword" + >where</span + ><span + > +</span + ><span id="line-3" + ></span + ><span + > +</span + ><span id="line-4" + ></span + ><span class="hs-keyword" + >import</span + ><span + > </span + ><span class="annot" + ><a href="Quasiquoter.html" + ><span class="hs-identifier" + >Quasiquoter</span + ></a + ></span + ><span + > +</span + ><span id="line-5" + ></span + ><span + > +</span + ><span id="line-6" + ></span + ><span id="baz" + ><span class="annot" + ><span class="annottext" + >baz :: [Char] +</span + ><a href="UsingQuasiquotes.html#baz" + ><span class="hs-identifier hs-var hs-var" + >baz</span + ></a + ></span + ></span + ><span + > </span + ><span class="hs-glyph" + >=</span + ><span + > </span + ><span class="annot" + ><span class="" + >[string| foo bar |]</span + ></span + ><span + > </span + ><span class="annot" + ><span class="annottext" + >[Char] -> [Char] -> [Char] +forall a. [a] -> [a] -> [a] +</span + ><span class="hs-operator hs-var" + >++</span + ></span + ><span + > </span + ><span class="annot" + ><span class="" + >[string| some + mulitline + quasiquote +|]</span + ></span + ><span + > +</span + ><span id="line-10" + ></span + ></pre + ></body + ></html +> diff --git a/hypsrc-test/src/Bug1091.hs b/hypsrc-test/src/Bug1091.hs new file mode 100644 index 00000000..f0cea033 --- /dev/null +++ b/hypsrc-test/src/Bug1091.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE CPP #-} +module Bug1091 where + +#include "Include1For1091.h" diff --git a/hypsrc-test/src/Include1For1091.h b/hypsrc-test/src/Include1For1091.h new file mode 100644 index 00000000..32854b95 --- /dev/null +++ b/hypsrc-test/src/Include1For1091.h @@ -0,0 +1,6 @@ +/* Include1For1091.h */ + +foo :: Int +foo = 42 + +#include "Include2For1091.h" diff --git a/hypsrc-test/src/Include2For1091.h b/hypsrc-test/src/Include2For1091.h new file mode 100644 index 00000000..c0848fa9 --- /dev/null +++ b/hypsrc-test/src/Include2For1091.h @@ -0,0 +1,4 @@ +/* Include2For1091.h */ + +bar :: Int +bar = 27 diff --git a/hypsrc-test/src/Quasiquoter.hs b/hypsrc-test/src/Quasiquoter.hs new file mode 100644 index 00000000..d0a46c33 --- /dev/null +++ b/hypsrc-test/src/Quasiquoter.hs @@ -0,0 +1,16 @@ +module Quasiquoter ( string ) where + +import Language.Haskell.TH.Quote +import Language.Haskell.TH.Syntax + +-- | Quoter for constructing multiline string literals +string :: QuasiQuoter +string = QuasiQuoter + { quoteExp = pure . LitE . StringL + , quotePat = invalidDomain + , quoteType = invalidDomain + , quoteDec = invalidDomain + } + where + invalidDomain :: String -> Q a + invalidDomain _ = fail "stringQuoter: only valid in expression context" diff --git a/hypsrc-test/src/TemplateHaskellQuasiquotes.hs b/hypsrc-test/src/TemplateHaskellQuasiquotes.hs new file mode 100644 index 00000000..a1661895 --- /dev/null +++ b/hypsrc-test/src/TemplateHaskellQuasiquotes.hs @@ -0,0 +1,39 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TemplateHaskellQuasiquotes where + +import Language.Haskell.TH + +aDecl :: DecsQ +aDecl = [d| + bar :: $aType -> [ (Int, String) ] + bar $aPattern = $anExpression + |] + +aPattern :: PatQ +aPattern = [p| + [ aCrazyLongVariableName + , _unused + , (y, z) + , ( $aNumberPattern, "hello") + ] + |] + +aNumberPattern :: PatQ +aNumberPattern = [p| + w @ v @ 4.5 + |] + +anExpression, anExpression2 :: ExpQ +anExpression = [e| + [ (1 + $anExpression2, "world") ] + |] +anExpression2 = [| (1 + round pi) |] + +aType :: TypeQ +aType = [t| + [ (Double, String) ] + |] + + + diff --git a/hypsrc-test/src/TemplateHaskellSplices.hs b/hypsrc-test/src/TemplateHaskellSplices.hs new file mode 100644 index 00000000..bbd3948e --- /dev/null +++ b/hypsrc-test/src/TemplateHaskellSplices.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} +module TemplateHaskellSplices where + +import TemplateHaskellQuasiquotes + +$(aDecl) + +foo = id $(anExpression2) diff --git a/hypsrc-test/src/UsingQuasiquotes.hs b/hypsrc-test/src/UsingQuasiquotes.hs new file mode 100644 index 00000000..34872d4d --- /dev/null +++ b/hypsrc-test/src/UsingQuasiquotes.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE QuasiQuotes #-} +module UsingQuasiquotes where + +import Quasiquoter + +baz = [string| foo bar |] ++ [string| some + mulitline + quasiquote +|] diff --git a/latex-test/Main.hs b/latex-test/Main.hs index 8d2a4922..17ae8ae8 100755 --- a/latex-test/Main.hs +++ b/latex-test/Main.hs @@ -19,7 +19,9 @@ checkConfig = CheckConfig dirConfig :: DirConfig -dirConfig = defaultDirConfig $ takeDirectory __FILE__ +dirConfig = (defaultDirConfig $ takeDirectory __FILE__) + { dcfgCheckIgnore = (`elem` ["haddock.sty", "main.tex"]) . takeFileName + } main :: IO () diff --git a/latex-test/ref/ConstructorArgs/ConstructorArgs.tex b/latex-test/ref/ConstructorArgs/ConstructorArgs.tex index 44304f47..053d2e41 100644 --- a/latex-test/ref/ConstructorArgs/ConstructorArgs.tex +++ b/latex-test/ref/ConstructorArgs/ConstructorArgs.tex @@ -3,15 +3,16 @@ \haddockbeginheader {\haddockverb\begin{verbatim} module ConstructorArgs ( - Foo((:|), Rec, Baz, Boa, (:*), x, y), Boo(Foo, Foa, Fo, Fo'), pattern Bo, - pattern Bo' + Foo((:|), Rec, Baz, Boa, (:*), x, y), Boo(Foo, Foa, Fo, Fo'), + pattern Bo, pattern Bo' ) where\end{verbatim}} \haddockendheader \begin{haddockdesc} \item[\begin{tabular}{@{}l} -data\ Foo -\end{tabular}]\haddockbegindoc +data Foo +\end{tabular}] +{\haddockbegindoc \enspace \emph{Constructors}\par \haddockbeginconstrs \haddockdecltt{=} & \haddockdecltt{Rec} & doc on a record \\ @@ -25,12 +26,13 @@ data\ Foo \haddockdecltt{|} & \haddockdecltt{(:*)} & doc on the \haddockid{:*} constructor \\ & \qquad \haddockdecltt{Int} & doc on the \haddockid{Int} field of the \haddockid{:*} constructor \\ & \qquad \haddockdecltt{String} & doc on the \haddockid{String} field of the \haddockid{:*} constructor \\ -\end{tabulary}\par +\end{tabulary}\par} \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -data\ Boo\ where -\end{tabular}]\haddockbegindoc +data Boo where +\end{tabular}] +{\haddockbegindoc \enspace \emph{Constructors}\par \haddockbeginconstrs & \haddockdecltt{Foo} & Info about a \haddockid{Foo} \\ @@ -46,24 +48,24 @@ data\ Boo\ where & \qquad \haddockdecltt{->} \enspace \haddockdecltt{String} & a \haddockid{String} \\ & \qquad \haddockdecltt{->} \enspace \haddockdecltt{Boo} & a \haddockid{Boo} \\ & \haddockdecltt{pattern Fo' :: Boo} & Bundled and no argument docs \\ -\end{tabulary}\par +\end{tabulary}\par} \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -pattern\ Bo -\end{tabular}]\haddockbegindoc +pattern Bo +\end{tabular}] +{\haddockbegindoc \haddockbeginargs \haddockdecltt{::} & \haddockdecltt{Int} & an \haddockid{Int} \\ \haddockdecltt{->} & \haddockdecltt{String} & a \haddockid{String} \\ \haddockdecltt{->} & \haddockdecltt{Boo} & a \haddockid{Boo} pattern \\ \end{tabulary}\par -Info about not-bundled \haddockid{Bo}\par - +Info about not-bundled \haddockid{Bo}\par} \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -pattern\ Bo'\ ::\ Int\ ->\ String\ ->\ Boo -\end{tabular}]\haddockbegindoc -Not bunded and no argument docs\par - +pattern Bo' :: Int -> String -> Boo +\end{tabular}] +{\haddockbegindoc +Not bunded and no argument docs\par} \end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/ConstructorArgs/haddock.sty b/latex-test/ref/ConstructorArgs/haddock.sty deleted file mode 100644 index 6e031a98..00000000 --- a/latex-test/ref/ConstructorArgs/haddock.sty +++ /dev/null @@ -1,57 +0,0 @@ -% Default Haddock style definitions. To use your own style, invoke -% Haddock with the option --latex-style=mystyle. - -\usepackage{tabulary} % see below - -% make hyperlinks in the PDF, and add an expandabale index -\usepackage[pdftex,bookmarks=true]{hyperref} - -\newenvironment{haddocktitle} - {\begin{center}\bgroup\large\bfseries} - {\egroup\end{center}} -\newenvironment{haddockprologue}{\vspace{1in}}{} - -\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} - -\newcommand{\haddockbeginheader}{\hrulefill} -\newcommand{\haddockendheader}{\noindent\hrulefill} - -% a little gap before the ``Methods'' header -\newcommand{\haddockpremethods}{\vspace{2ex}} - -% inserted before \\begin{verbatim} -\newcommand{\haddockverb}{\small} - -% an identifier: add an index entry -\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} - -% The tabulary environment lets us have a column that takes up ``the -% rest of the space''. Unfortunately it doesn't allow -% the \end{tabulary} to be in the expansion of a macro, it must appear -% literally in the document text, so Haddock inserts -% the \end{tabulary} itself. -\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} -\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} - -\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} -\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} - -\makeatletter -\newenvironment{haddockdesc} - {\list{}{\labelwidth\z@ \itemindent-\leftmargin - \let\makelabel\haddocklabel}} - {\endlist} -\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} -\makeatother - -% after a declaration, start a new line for the documentation. -% Otherwise, the documentation starts right after the declaration, -% because we're using the list environment and the declaration is the -% ``label''. I tried making this newline part of the label, but -% couldn't get that to work reliably (the space seemed to stretch -% sometimes). -\newcommand{\haddockbegindoc}{\hfill\\[1ex]} - -% spacing between paragraphs and no \parindent looks better -\parskip=10pt plus2pt minus2pt -\setlength{\parindent}{0cm} diff --git a/latex-test/ref/ConstructorArgs/main.tex b/latex-test/ref/ConstructorArgs/main.tex deleted file mode 100644 index 80f639c5..00000000 --- a/latex-test/ref/ConstructorArgs/main.tex +++ /dev/null @@ -1,11 +0,0 @@ -\documentclass{book} -\usepackage{haddock} -\begin{document} -\begin{titlepage} -\begin{haddocktitle} - -\end{haddocktitle} -\end{titlepage} -\tableofcontents -\input{ConstructorArgs} -\end{document}
\ No newline at end of file diff --git a/latex-test/ref/DefaultSignatures/DefaultSignatures.tex b/latex-test/ref/DefaultSignatures/DefaultSignatures.tex new file mode 100644 index 00000000..162f5014 --- /dev/null +++ b/latex-test/ref/DefaultSignatures/DefaultSignatures.tex @@ -0,0 +1,41 @@ +\haddockmoduleheading{DefaultSignatures} +\label{module:DefaultSignatures} +\haddockbeginheader +{\haddockverb\begin{verbatim} +module DefaultSignatures ( + Foo(baz', baz, bar) + ) where\end{verbatim}} +\haddockendheader + +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +class Foo a where +\end{tabular}] +{\haddockbegindoc +Documentation for Foo.\par +\haddockpremethods{}\emph{Methods} +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +bar, baz :: a -> String +\end{tabular}] +{\haddockbegindoc +Documentation for bar and baz.\par} +\end{haddockdesc} +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +default bar :: Show a => a -> String +\end{tabular}] +\end{haddockdesc} +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +baz' :: String -> a +\end{tabular}] +{\haddockbegindoc +Documentation for baz'.\par} +\end{haddockdesc} +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +default baz' :: Read a => String -> a +\end{tabular}] +\end{haddockdesc}} +\end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/Deprecated/Deprecated.tex b/latex-test/ref/Deprecated/Deprecated.tex new file mode 100644 index 00000000..0ae2410b --- /dev/null +++ b/latex-test/ref/Deprecated/Deprecated.tex @@ -0,0 +1,17 @@ +\haddockmoduleheading{Deprecated} +\label{module:Deprecated} +\haddockbeginheader +{\haddockverb\begin{verbatim} +module Deprecated ( + deprecated + ) where\end{verbatim}} +\haddockendheader + +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +deprecated :: Int +\end{tabular}] +{\haddockbegindoc +Deprecated: Don't use this\par +Docs for something deprecated\par} +\end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/Example/Example.tex b/latex-test/ref/Example/Example.tex new file mode 100644 index 00000000..11f7e734 --- /dev/null +++ b/latex-test/ref/Example/Example.tex @@ -0,0 +1,30 @@ +\haddockmoduleheading{Example} +\label{module:Example} +\haddockbeginheader +{\haddockverb\begin{verbatim} +module Example ( + split + ) where\end{verbatim}} +\haddockendheader + +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +split :: Int -> () +\end{tabular}] +{\haddockbegindoc +Example use.\par +\begin{quote} +{\haddockverb\begin{verbatim} +>>> split 1 +() + +\end{verbatim}} +\end{quote} +\begin{quote} +{\haddockverb\begin{verbatim} +>>> split 2 +() + +\end{verbatim}} +\end{quote}} +\end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex b/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex index 7aaf5512..9953ce55 100644 --- a/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex +++ b/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex @@ -9,17 +9,18 @@ module GadtConstructorArgs ( \begin{haddockdesc} \item[\begin{tabular}{@{}l} -data\ Boo\ where -\end{tabular}]\haddockbegindoc +data Boo where +\end{tabular}] +{\haddockbegindoc \enspace \emph{Constructors}\par \haddockbeginconstrs & \haddockdecltt{Fot} & \\ - & \qquad \haddockdecltt{:: \{} \enspace \haddockdecltt{x :: Int} & an \haddockid{x} \\ + & \qquad \haddockdecltt{:: {\char '173}} \enspace \haddockdecltt{x :: Int} & an \haddockid{x} \\ & \qquad \haddockdecltt{\ \ \ \ ,} \enspace \haddockdecltt{y :: Int} & a \haddockid{y} \\ - & \qquad \haddockdecltt{\ \ \ \ \} ->} \enspace \haddockdecltt{Boo} & \\ + & \qquad \haddockdecltt{\ \ \ \ {\char '175} ->} \enspace \haddockdecltt{Boo} & \\ & \haddockdecltt{Fob} & Record GADT with docs \\ - & \qquad \haddockdecltt{:: \{} \enspace \haddockdecltt{w :: Int} & a \haddockid{w} \\ + & \qquad \haddockdecltt{:: {\char '173}} \enspace \haddockdecltt{w :: Int} & a \haddockid{w} \\ & \qquad \haddockdecltt{\ \ \ \ ,} \enspace \haddockdecltt{z :: Int} & a \haddockid{z} \\ - & \qquad \haddockdecltt{\ \ \ \ \} ->} \enspace \haddockdecltt{Boo} & a \haddockid{Boo} \\ -\end{tabulary}\par + & \qquad \haddockdecltt{\ \ \ \ {\char '175} ->} \enspace \haddockdecltt{Boo} & a \haddockid{Boo} \\ +\end{tabulary}\par} \end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/GadtConstructorArgs/haddock.sty b/latex-test/ref/GadtConstructorArgs/haddock.sty deleted file mode 100644 index 6e031a98..00000000 --- a/latex-test/ref/GadtConstructorArgs/haddock.sty +++ /dev/null @@ -1,57 +0,0 @@ -% Default Haddock style definitions. To use your own style, invoke -% Haddock with the option --latex-style=mystyle. - -\usepackage{tabulary} % see below - -% make hyperlinks in the PDF, and add an expandabale index -\usepackage[pdftex,bookmarks=true]{hyperref} - -\newenvironment{haddocktitle} - {\begin{center}\bgroup\large\bfseries} - {\egroup\end{center}} -\newenvironment{haddockprologue}{\vspace{1in}}{} - -\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} - -\newcommand{\haddockbeginheader}{\hrulefill} -\newcommand{\haddockendheader}{\noindent\hrulefill} - -% a little gap before the ``Methods'' header -\newcommand{\haddockpremethods}{\vspace{2ex}} - -% inserted before \\begin{verbatim} -\newcommand{\haddockverb}{\small} - -% an identifier: add an index entry -\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} - -% The tabulary environment lets us have a column that takes up ``the -% rest of the space''. Unfortunately it doesn't allow -% the \end{tabulary} to be in the expansion of a macro, it must appear -% literally in the document text, so Haddock inserts -% the \end{tabulary} itself. -\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} -\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} - -\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} -\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} - -\makeatletter -\newenvironment{haddockdesc} - {\list{}{\labelwidth\z@ \itemindent-\leftmargin - \let\makelabel\haddocklabel}} - {\endlist} -\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} -\makeatother - -% after a declaration, start a new line for the documentation. -% Otherwise, the documentation starts right after the declaration, -% because we're using the list environment and the declaration is the -% ``label''. I tried making this newline part of the label, but -% couldn't get that to work reliably (the space seemed to stretch -% sometimes). -\newcommand{\haddockbegindoc}{\hfill\\[1ex]} - -% spacing between paragraphs and no \parindent looks better -\parskip=10pt plus2pt minus2pt -\setlength{\parindent}{0cm} diff --git a/latex-test/ref/GadtConstructorArgs/main.tex b/latex-test/ref/GadtConstructorArgs/main.tex deleted file mode 100644 index dc1a1aa3..00000000 --- a/latex-test/ref/GadtConstructorArgs/main.tex +++ /dev/null @@ -1,11 +0,0 @@ -\documentclass{book} -\usepackage{haddock} -\begin{document} -\begin{titlepage} -\begin{haddocktitle} - -\end{haddocktitle} -\end{titlepage} -\tableofcontents -\input{GadtConstructorArgs} -\end{document}
\ No newline at end of file diff --git a/latex-test/ref/NamespacedIdentifier/NamespacedIdentifiers.tex b/latex-test/ref/NamespacedIdentifier/NamespacedIdentifiers.tex new file mode 100644 index 00000000..44c052c6 --- /dev/null +++ b/latex-test/ref/NamespacedIdentifier/NamespacedIdentifiers.tex @@ -0,0 +1,37 @@ +\haddockmoduleheading{NamespacedIdentifiers} +\label{module:NamespacedIdentifiers} +\haddockbeginheader +{\haddockverb\begin{verbatim} +module NamespacedIdentifiers ( + Foo(Bar), Bar + ) where\end{verbatim}} +\haddockendheader + +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +data Foo +\end{tabular}] +{\haddockbegindoc +A link to:\par +\vbox{\begin{itemize} +\item +the type \haddockid{Bar}\par +\item +the constructor \haddockid{Bar}\par +\item +the unimported but qualified type \haddockid{A}\par +\item +the unimported but qualified value \haddockid{A}\par +\end{itemize}} +\enspace \emph{Constructors}\par +\haddockbeginconstrs +\haddockdecltt{=} & \haddockdecltt{Bar} & \\ +\end{tabulary}\par} +\end{haddockdesc} +\begin{haddockdesc} +\item[\begin{tabular}{@{}l} +data Bar +\end{tabular}] +{\haddockbegindoc +A link to the value \haddocktt{Foo} (which shouldn't exist).\par} +\end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/Simple/Simple.tex b/latex-test/ref/Simple/Simple.tex index 5ba4712c..96e9338a 100644 --- a/latex-test/ref/Simple/Simple.tex +++ b/latex-test/ref/Simple/Simple.tex @@ -9,8 +9,8 @@ module Simple ( \begin{haddockdesc} \item[\begin{tabular}{@{}l} -foo\ ::\ t -\end{tabular}]\haddockbegindoc -This is foo.\par - +foo :: t +\end{tabular}] +{\haddockbegindoc +This is foo.\par} \end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/Simple/haddock.sty b/latex-test/ref/Simple/haddock.sty deleted file mode 100644 index 6e031a98..00000000 --- a/latex-test/ref/Simple/haddock.sty +++ /dev/null @@ -1,57 +0,0 @@ -% Default Haddock style definitions. To use your own style, invoke -% Haddock with the option --latex-style=mystyle. - -\usepackage{tabulary} % see below - -% make hyperlinks in the PDF, and add an expandabale index -\usepackage[pdftex,bookmarks=true]{hyperref} - -\newenvironment{haddocktitle} - {\begin{center}\bgroup\large\bfseries} - {\egroup\end{center}} -\newenvironment{haddockprologue}{\vspace{1in}}{} - -\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} - -\newcommand{\haddockbeginheader}{\hrulefill} -\newcommand{\haddockendheader}{\noindent\hrulefill} - -% a little gap before the ``Methods'' header -\newcommand{\haddockpremethods}{\vspace{2ex}} - -% inserted before \\begin{verbatim} -\newcommand{\haddockverb}{\small} - -% an identifier: add an index entry -\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} - -% The tabulary environment lets us have a column that takes up ``the -% rest of the space''. Unfortunately it doesn't allow -% the \end{tabulary} to be in the expansion of a macro, it must appear -% literally in the document text, so Haddock inserts -% the \end{tabulary} itself. -\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} -\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} - -\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} -\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} - -\makeatletter -\newenvironment{haddockdesc} - {\list{}{\labelwidth\z@ \itemindent-\leftmargin - \let\makelabel\haddocklabel}} - {\endlist} -\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} -\makeatother - -% after a declaration, start a new line for the documentation. -% Otherwise, the documentation starts right after the declaration, -% because we're using the list environment and the declaration is the -% ``label''. I tried making this newline part of the label, but -% couldn't get that to work reliably (the space seemed to stretch -% sometimes). -\newcommand{\haddockbegindoc}{\hfill\\[1ex]} - -% spacing between paragraphs and no \parindent looks better -\parskip=10pt plus2pt minus2pt -\setlength{\parindent}{0cm} diff --git a/latex-test/ref/Simple/main.tex b/latex-test/ref/Simple/main.tex deleted file mode 100644 index 36536981..00000000 --- a/latex-test/ref/Simple/main.tex +++ /dev/null @@ -1,11 +0,0 @@ -\documentclass{book} -\usepackage{haddock} -\begin{document} -\begin{titlepage} -\begin{haddocktitle} - -\end{haddocktitle} -\end{titlepage} -\tableofcontents -\input{Simple} -\end{document}
\ No newline at end of file diff --git a/latex-test/ref/TypeFamilies3/TypeFamilies3.tex b/latex-test/ref/TypeFamilies3/TypeFamilies3.tex index 2a8ad297..d8787704 100644 --- a/latex-test/ref/TypeFamilies3/TypeFamilies3.tex +++ b/latex-test/ref/TypeFamilies3/TypeFamilies3.tex @@ -3,42 +3,42 @@ \haddockbeginheader {\haddockverb\begin{verbatim} module TypeFamilies3 ( - Foo, Bar, Baz(Baz3, Baz2, Baz1) + Foo, Bar, Baz(Baz3, Baz2, Baz1) ) where\end{verbatim}} \haddockendheader \begin{haddockdesc} \item[\begin{tabular}{@{}l} -type\ family\ Foo\ a\ where -\end{tabular}]\haddockbegindoc +type family Foo a where +\end{tabular}] +{\haddockbegindoc \haddockbeginargs \haddockdecltt{Foo () = Int} \\ -\haddockdecltt{Foo \_ = ()} \\ +\haddockdecltt{Foo {\char '137} = ()} \\ \end{tabulary}\par -A closed type family\par - +A closed type family\par} \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -type\ family\ Bar\ a -\end{tabular}]\haddockbegindoc -An open family\par - +type family Bar a +\end{tabular}] +{\haddockbegindoc +An open family\par} \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -type\ instance\ Bar\ Int\ =\ ()\\type\ instance\ Bar\ ()\ =\ Int +type instance Bar Int = ()\\type instance Bar () = Int \end{tabular}] \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -data\ family\ Baz\ a -\end{tabular}]\haddockbegindoc -A data family\par - +data family Baz a +\end{tabular}] +{\haddockbegindoc +A data family\par} \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -newtype\ instance\ Baz\ Double\\data\ instance\ Baz\ Int\\data\ instance\ Baz\ () +newtype instance Baz Double\\data instance Baz Int\\data instance Baz () \end{tabular}] \end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/TypeFamilies3/haddock.sty b/latex-test/ref/TypeFamilies3/haddock.sty deleted file mode 100644 index 6e031a98..00000000 --- a/latex-test/ref/TypeFamilies3/haddock.sty +++ /dev/null @@ -1,57 +0,0 @@ -% Default Haddock style definitions. To use your own style, invoke -% Haddock with the option --latex-style=mystyle. - -\usepackage{tabulary} % see below - -% make hyperlinks in the PDF, and add an expandabale index -\usepackage[pdftex,bookmarks=true]{hyperref} - -\newenvironment{haddocktitle} - {\begin{center}\bgroup\large\bfseries} - {\egroup\end{center}} -\newenvironment{haddockprologue}{\vspace{1in}}{} - -\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} - -\newcommand{\haddockbeginheader}{\hrulefill} -\newcommand{\haddockendheader}{\noindent\hrulefill} - -% a little gap before the ``Methods'' header -\newcommand{\haddockpremethods}{\vspace{2ex}} - -% inserted before \\begin{verbatim} -\newcommand{\haddockverb}{\small} - -% an identifier: add an index entry -\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} - -% The tabulary environment lets us have a column that takes up ``the -% rest of the space''. Unfortunately it doesn't allow -% the \end{tabulary} to be in the expansion of a macro, it must appear -% literally in the document text, so Haddock inserts -% the \end{tabulary} itself. -\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} -\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} - -\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} -\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} - -\makeatletter -\newenvironment{haddockdesc} - {\list{}{\labelwidth\z@ \itemindent-\leftmargin - \let\makelabel\haddocklabel}} - {\endlist} -\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} -\makeatother - -% after a declaration, start a new line for the documentation. -% Otherwise, the documentation starts right after the declaration, -% because we're using the list environment and the declaration is the -% ``label''. I tried making this newline part of the label, but -% couldn't get that to work reliably (the space seemed to stretch -% sometimes). -\newcommand{\haddockbegindoc}{\hfill\\[1ex]} - -% spacing between paragraphs and no \parindent looks better -\parskip=10pt plus2pt minus2pt -\setlength{\parindent}{0cm} diff --git a/latex-test/ref/TypeFamilies3/main.tex b/latex-test/ref/TypeFamilies3/main.tex deleted file mode 100644 index 2c98043c..00000000 --- a/latex-test/ref/TypeFamilies3/main.tex +++ /dev/null @@ -1,11 +0,0 @@ -\documentclass{book} -\usepackage{haddock} -\begin{document} -\begin{titlepage} -\begin{haddocktitle} - -\end{haddocktitle} -\end{titlepage} -\tableofcontents -\input{TypeFamilies3} -\end{document}
\ No newline at end of file diff --git a/latex-test/ref/UnboxedStuff/UnboxedStuff.tex b/latex-test/ref/UnboxedStuff/UnboxedStuff.tex index 36d5c12b..990d2a5b 100644 --- a/latex-test/ref/UnboxedStuff/UnboxedStuff.tex +++ b/latex-test/ref/UnboxedStuff/UnboxedStuff.tex @@ -3,34 +3,34 @@ \haddockbeginheader {\haddockverb\begin{verbatim} module UnboxedStuff ( - X, Y, Z, unboxedUnit, unboxedTuple, unboxedSum + X, Y, Z, unboxedUnit, unboxedTuple, unboxedSum ) where\end{verbatim}} \haddockendheader \begin{haddockdesc} \item[\begin{tabular}{@{}l} -data\ X +data X \end{tabular}] \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -data\ Y +data Y \end{tabular}] \end{haddockdesc} \begin{haddockdesc} \item[\begin{tabular}{@{}l} -data\ Z +data Z \end{tabular}] \end{haddockdesc} \section{Unboxed type constructors} \begin{haddockdesc} -\item[ -unboxedUnit\ ::\ ({\char '43}\ {\char '43})\ ->\ ({\char '43}\ {\char '43}) -] -\item[ -unboxedTuple\ ::\ ({\char '43}\ X,\ Y\ {\char '43})\ ->\ ({\char '43}\ X,\ Y,\ Z\ {\char '43}) -] -\item[ -unboxedSum\ ::\ ({\char '43}\ X\ |\ Y\ {\char '43})\ ->\ ({\char '43}\ X\ |\ Y\ |\ Z\ {\char '43}) -] +\item[\begin{tabular}{@{}l} +unboxedUnit :: ({\char '43} {\char '43}) -> ({\char '43} {\char '43}) +\end{tabular}] +\item[\begin{tabular}{@{}l} +unboxedTuple :: ({\char '43} X, Y {\char '43}) -> ({\char '43} X, Y, Z {\char '43}) +\end{tabular}] +\item[\begin{tabular}{@{}l} +unboxedSum :: ({\char '43} X | Y {\char '43}) -> ({\char '43} X | Y | Z {\char '43}) +\end{tabular}] \end{haddockdesc}
\ No newline at end of file diff --git a/latex-test/ref/UnboxedStuff/haddock.sty b/latex-test/ref/UnboxedStuff/haddock.sty deleted file mode 100644 index 6e031a98..00000000 --- a/latex-test/ref/UnboxedStuff/haddock.sty +++ /dev/null @@ -1,57 +0,0 @@ -% Default Haddock style definitions. To use your own style, invoke -% Haddock with the option --latex-style=mystyle. - -\usepackage{tabulary} % see below - -% make hyperlinks in the PDF, and add an expandabale index -\usepackage[pdftex,bookmarks=true]{hyperref} - -\newenvironment{haddocktitle} - {\begin{center}\bgroup\large\bfseries} - {\egroup\end{center}} -\newenvironment{haddockprologue}{\vspace{1in}}{} - -\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} - -\newcommand{\haddockbeginheader}{\hrulefill} -\newcommand{\haddockendheader}{\noindent\hrulefill} - -% a little gap before the ``Methods'' header -\newcommand{\haddockpremethods}{\vspace{2ex}} - -% inserted before \\begin{verbatim} -\newcommand{\haddockverb}{\small} - -% an identifier: add an index entry -\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} - -% The tabulary environment lets us have a column that takes up ``the -% rest of the space''. Unfortunately it doesn't allow -% the \end{tabulary} to be in the expansion of a macro, it must appear -% literally in the document text, so Haddock inserts -% the \end{tabulary} itself. -\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} -\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} - -\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} -\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} - -\makeatletter -\newenvironment{haddockdesc} - {\list{}{\labelwidth\z@ \itemindent-\leftmargin - \let\makelabel\haddocklabel}} - {\endlist} -\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} -\makeatother - -% after a declaration, start a new line for the documentation. -% Otherwise, the documentation starts right after the declaration, -% because we're using the list environment and the declaration is the -% ``label''. I tried making this newline part of the label, but -% couldn't get that to work reliably (the space seemed to stretch -% sometimes). -\newcommand{\haddockbegindoc}{\hfill\\[1ex]} - -% spacing between paragraphs and no \parindent looks better -\parskip=10pt plus2pt minus2pt -\setlength{\parindent}{0cm} diff --git a/latex-test/ref/UnboxedStuff/main.tex b/latex-test/ref/UnboxedStuff/main.tex deleted file mode 100644 index e34c5f14..00000000 --- a/latex-test/ref/UnboxedStuff/main.tex +++ /dev/null @@ -1,11 +0,0 @@ -\documentclass{book} -\usepackage{haddock} -\begin{document} -\begin{titlepage} -\begin{haddocktitle} - -\end{haddocktitle} -\end{titlepage} -\tableofcontents -\input{UnboxedStuff} -\end{document}
\ No newline at end of file diff --git a/latex-test/src/DefaultSignatures/DefaultSignatures.hs b/latex-test/src/DefaultSignatures/DefaultSignatures.hs new file mode 100644 index 00000000..52d68a96 --- /dev/null +++ b/latex-test/src/DefaultSignatures/DefaultSignatures.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE DefaultSignatures #-} + +module DefaultSignatures where + +-- | Documentation for Foo. +class Foo a where + -- | Documentation for bar and baz. + bar, baz :: a -> String + + -- | Documentation for the default signature of bar. + default bar :: Show a => a -> String + bar = show + + -- | Documentation for baz'. + baz' :: String -> a + + -- | Documentation for the default signature of baz'. + default baz' :: Read a => String -> a + baz' = read diff --git a/latex-test/src/Deprecated/Deprecated.hs b/latex-test/src/Deprecated/Deprecated.hs new file mode 100644 index 00000000..aecec94e --- /dev/null +++ b/latex-test/src/Deprecated/Deprecated.hs @@ -0,0 +1,7 @@ +module Deprecated where + +-- | Docs for something deprecated +deprecated :: Int +deprecated = 1 + +{-# DEPRECATED deprecated "Don't use this" #-} diff --git a/latex-test/src/Example/Example.hs b/latex-test/src/Example/Example.hs new file mode 100644 index 00000000..42ff1646 --- /dev/null +++ b/latex-test/src/Example/Example.hs @@ -0,0 +1,11 @@ +module Example where + +-- | Example use. +-- +-- >>> split 1 +-- () +-- +-- >>> split 2 +-- () +split :: Int -> () +split _ = () diff --git a/latex-test/src/NamespacedIdentifier/NamespacedIdentifier.hs b/latex-test/src/NamespacedIdentifier/NamespacedIdentifier.hs new file mode 100644 index 00000000..6f59d247 --- /dev/null +++ b/latex-test/src/NamespacedIdentifier/NamespacedIdentifier.hs @@ -0,0 +1,13 @@ +module NamespacedIdentifiers where + +-- | A link to: +-- +-- * the type t'Bar' +-- * the constructor v'Bar' +-- * the unimported but qualified type t'A.A' +-- * the unimported but qualified value v'A.A' +-- +data Foo = Bar + +-- | A link to the value v'Foo' (which shouldn't exist). +data Bar diff --git a/scripts/build-windows-dist.sh b/scripts/build-windows-dist.sh deleted file mode 100644 index 2ae7dd2a..00000000 --- a/scripts/build-windows-dist.sh +++ /dev/null @@ -1,18 +0,0 @@ -# mini script for building the relocatable Windows binary distribution.
-#
-# sh build-windows-dist.sh
-#
-# NB. the Cabal that shipped with GHC 6.6 isn't enough for this, because it
-# is missing this patch:
-#
-# Fri Oct 13 11:09:41 BST 2006 Simon Marlow <simonmar@microsoft.com>
-# * Fix getDataDir etc. when bindir=$prefix
-#
-# So you need to use a more recent Cabal. GHC 6.6 is fine for building the
-# package, though.
-
-ghc --make Setup
-./Setup configure --prefix=`pwd`/install --bindir='$prefix' --libdir='$prefix' --datadir='$prefix'
-./Setup build
-./Setup install
-echo Now zip up `pwd`/install as "haddock-<version>-Win32.zip"
diff --git a/scripts/make-sdist.sh b/scripts/make-sdist.sh deleted file mode 100644 index 914bf909..00000000 --- a/scripts/make-sdist.sh +++ /dev/null @@ -1,36 +0,0 @@ -# Put the Happy-generated .hs files in the right place in the source dist. -set -e -rm -f dist/haddock-*.tar.gz -rm -rf dist/haddock-*/ -./Setup sdist -cd dist -tar xvzf haddock-*.tar.gz -cd haddock-*/ -mkdir dist -mkdir dist/build -mv haddock dist/build -cd .. -tar cvzf haddock-*.tar.gz haddock-*/ - -# Steps for doing a release: -# * Update version number in .cabal, doc/haddock.xml -# * Update CHANGES -# * Source: -# - do the above -# - upload the dist to haskell.org:haddock/dist/${version} -# - scp CHANGES haskell.org:haddock/CHANGES.txt -# * Binaries: -# - build the Windows binary zip (see build-windows-dist.sh) -# - scp haddock-<version>-Win32.zip haskell.org:haddock/dist -# * Documentation: -# - cd doc -# - make html -# - mv haddock haddock-html -# - tar cvzf haddock-doc-html-${version}.tar.gz haddock-html -# - scp haddock-doc-html-${version}.tar.gz www.haskell.org:../haskell/haddock/doc -# - ssh haskell.org -# - cd haddock/doc -# - tar xvzf haddock-doc-html-${version}.tar.gz -# - rm -rf html-OLD -# - mv html html-OLD && mv haddock-html html -# * Update the web page (~/darcs/www/haddock/index.html), and push it |