From fad27a5caa9a20f975c75bf86a1798be1411de48 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Sun, 26 Nov 2023 17:43:13 +0100 Subject: [PATCH] chore: Test with more GHC versions --- .github/workflows/haskell-ci.yml | 34 +++++++++++++++++++-- README.md | 3 +- pandoc-builder-monadic.cabal | 11 ++++++- src/Text/Pandoc/Builder/Monadic/Internal.hs | 6 ++++ 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index f80cdb6..1794915 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -43,6 +43,36 @@ jobs: compilerVersion: 9.2.8 setup-method: ghcup allow-failure: false + - compiler: ghc-9.0.2 + compilerKind: ghc + compilerVersion: 9.0.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.10.7 + compilerKind: ghc + compilerVersion: 8.10.7 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.8.4 + compilerKind: ghc + compilerVersion: 8.8.4 + setup-method: hvr-ppa + allow-failure: false + - compiler: ghc-8.6.5 + compilerKind: ghc + compilerVersion: 8.6.5 + setup-method: hvr-ppa + allow-failure: false + - compiler: ghc-8.4.4 + compilerKind: ghc + compilerVersion: 8.4.4 + setup-method: hvr-ppa + allow-failure: false + - compiler: ghc-8.2.2 + compilerKind: ghc + compilerVersion: 8.2.2 + setup-method: hvr-ppa + allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 @@ -174,8 +204,8 @@ jobs: touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_pandoc_builder_monadic}" >> cabal.project - if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then echo "package pandoc-builder-monadic" >> cabal.project ; fi - if [ $((HCNUMVER >= 90200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package pandoc-builder-monadic" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project.local diff --git a/README.md b/README.md index 2792a4d..0442f2a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # pandoc-builder-monadic - -[![CI status badge](https://img.shields.io/github/actions/workflow/status/414owen/pandoc-builder-monadic/haskell-ci.yml)](https://github.com/414owen/pandoc-builder-monadic/actions/workflows/haskell-ci.yml) [![Hackage version badge](https://img.shields.io/hackage/v/pandoc-builder-monadic)](https://hackage.haskell.org/package/pandoc-builder-monadic) [![license](https://img.shields.io/github/license/414owen/pandoc-builder-monadic)](https://github.com/414owen/pandoc-builder-monadic/blob/master/LICENSE) +[![GHC version badge](https://img.shields.io/badge/ghc-%3E%3D8.0.2-blue?logo=haskell)](https://www.haskell.org/) [![CI status badge](https://img.shields.io/github/actions/workflow/status/414owen/pandoc-builder-monadic/haskell-ci.yml)](https://github.com/414owen/pandoc-builder-monadic/actions/workflows/haskell-ci.yml) [![Hackage version badge](https://img.shields.io/hackage/v/pandoc-builder-monadic)](https://hackage.haskell.org/package/pandoc-builder-monadic) [![license](https://img.shields.io/github/license/414owen/pandoc-builder-monadic)](https://github.com/414owen/pandoc-builder-monadic/blob/master/LICENSE) This library provides a monadic DSL for constructing Pandoc documents. diff --git a/pandoc-builder-monadic.cabal b/pandoc-builder-monadic.cabal index 7e06ab7..575d4e8 100644 --- a/pandoc-builder-monadic.cabal +++ b/pandoc-builder-monadic.cabal @@ -14,7 +14,16 @@ maintainer: owen@owen.cafe category: Text build-type: Simple extra-source-files: README.md CHANGELOG.md -tested-with: GHC==9.6.2, GHC==9.4.5, GHC==9.2.8, GHC==8.0.2 +tested-with: GHC==9.6.2 + , GHC==9.4.5 + , GHC==9.2.8 + , GHC==9.0.2 + , GHC==8.10.7 + , GHC==8.8.4 + , GHC==8.6.5 + , GHC==8.4.4 + , GHC==8.2.2 + , GHC==8.0.2 common warnings ghc-options: -Wall -Wextra -Wunused-packages diff --git a/src/Text/Pandoc/Builder/Monadic/Internal.hs b/src/Text/Pandoc/Builder/Monadic/Internal.hs index 2f13a91..ca7bbdc 100644 --- a/src/Text/Pandoc/Builder/Monadic/Internal.hs +++ b/src/Text/Pandoc/Builder/Monadic/Internal.hs @@ -55,6 +55,12 @@ instance Semigroup (BuilderM el a) where instance Monoid a => Monoid (BuilderM el a) where mempty = Builder $ pure mempty +#if !(MIN_VERSION_base(4,11,0)) + mappend f g = do + a <- f + b <- g + pure (mappend a b) +#endif instance B.ToMetaValue (Builder Inline) where toMetaValue = B.MetaInlines . runToList