Skip to content

Commit

Permalink
docs: change to use __HADDOCK_VERSION__ macro instead of __HADDOCK__,…
Browse files Browse the repository at this point in the history
… as the former is automatically defined by cabal
  • Loading branch information
david-davies committed Nov 29, 2024
1 parent ef4671c commit 4e88324
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ jobs:
cabal test $CONFIG --test-options="--color always"
- name: Doc
# Define the `__HADDOCK__` C macro only for the documentation generation.
# This is used when generating the type-specialised docs, but allows
# the actual haskell library to export the non-specialised versions.
run: cabal haddock gigaparsec --haddock-options=--optghc=-cpp --haddock-options=--optghc=-D__HADDOCK__ $CONFIG
run: cabal haddock gigaparsec

deploy:
name: Deploy Docs
Expand Down Expand Up @@ -99,7 +96,7 @@ jobs:
${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
- name: Doc
run: cabal haddock gigaparsec --enable-doc --haddock-hyperlink-source --haddock-quickjump --haddock-html-location='https://hackage.haskell.org/package/$pkg-$version/docs' --haddock-options=--optghc=-cpp --haddock-options=--optghc=-D__HADDOCK__
run: cabal haddock gigaparsec --enable-doc --haddock-hyperlink-source --haddock-quickjump --haddock-html-location='https://hackage.haskell.org/package/$pkg-$version/docs'

- name: Prepare to upload built htmls
run: cp -r ./$(find dist-newstyle -path '*/doc/html/gigaparsec') site
Expand Down
5 changes: 0 additions & 5 deletions generate-haddock

This file was deleted.

4 changes: 2 additions & 2 deletions src/Text/Gigaparsec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ import Text.Gigaparsec.Errors.ErrorGen (vanillaGen)

-- We want to improve the docs for Applicative, so we do some trickery with redefinitions
-- *only* for the haddock generation.
#ifdef __HADDOCK__
#ifdef __HADDOCK_VERSION__
{-# LANGUAGE NoImplicitPrelude #-}
import Prelude hiding ((<$>), (<$), (<*>), (*>), (<*), pure, liftA2)

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 8.10, Cabal 3.6

The module ‘Prelude’ does not have an explicit import list

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 8.10, Cabal 3.6

The module ‘Prelude’ does not have an explicit import list

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 8.10, Cabal 3.6

Module ‘Prelude’ does not export ‘liftA2’

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 8.10, Cabal latest

The module ‘Prelude’ does not have an explicit import list

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 8.10, Cabal latest

Module ‘Prelude’ does not export ‘liftA2’

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.2, Cabal 3.6

The module ‘Prelude’ does not have an explicit import list

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.2, Cabal 3.6

Module ‘Prelude’ does not export ‘liftA2’

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.2, Cabal 3.6

The module ‘Prelude’ does not have an explicit import list

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.2, Cabal 3.6

Module ‘Prelude’ does not export ‘liftA2’

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.2, Cabal latest

The module ‘Prelude’ does not have an explicit import list

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.2, Cabal latest

Module ‘Prelude’ does not export ‘liftA2’

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.4, Cabal latest

Module ‘Prelude’ does not export ‘liftA2’

Check warning on line 105 in src/Text/Gigaparsec.hs

View workflow job for this annotation

GitHub Actions / GHC 9.4, Cabal latest

The module ‘Prelude’ does not have an explicit import list
import Prelude qualified
Expand Down Expand Up @@ -574,7 +574,7 @@ We use some C++ macro stuff to only redefine these re-exports for the gigaparsec
which lets us provide more descriptive (and specialised) documentation for combinators.
-}

#ifdef __HADDOCK__
#ifdef __HADDOCK_VERSION__
{-|
Repeatedly parse the given parser __zero__ or more times, collecting the results into a list.
Expand Down

0 comments on commit 4e88324

Please sign in to comment.