diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ca46c8..361477f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,9 +124,9 @@ jobs: name: ${{ matrix.os }}-${{ matrix.ghc }}-plan.json path: mtl-*/dist-newstyle/cache/plan.json -# - name: Test -# run: | -# cabal --enable-tests --test-show-details=direct all + - name: Test + run: | + cabal test - name: Haddock run: | @@ -166,12 +166,16 @@ jobs: # build stack build + - name: Test + run: | + stack test + mhs: name: "MicroHS ${{ matrix.mhs }}" runs-on: ubuntu-latest strategy: matrix: - mhs: ["0.15.4.0"] + mhs: ["0.16.0.0"] fail-fast: false steps: - name: checkout mhs repo @@ -196,3 +200,8 @@ jobs: run: | cd mtl mcabal -r install + + - name: test + run: | + cd mtl + mcabal test diff --git a/.gitignore b/.gitignore index 55a715d..bcca8b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ dist dist-boot dist-install +dist-mcabal dist-newstyle ghc.mk GNUmakefile @@ -20,6 +21,7 @@ cabal.sandbox.config *.hp *.eventlog .stack-work/ +stack.yaml* cabal.project.local* .HTF/ .ghc.environment.* diff --git a/Control/Monad/Cont/Class.hs b/Control/Monad/Cont/Class.hs index 6bc4d78..9d85be6 100644 --- a/Control/Monad/Cont/Class.hs +++ b/Control/Monad/Cont/Class.hs @@ -114,12 +114,7 @@ class Monad m => MonadCont (m :: Type -> Type) where {-# MINIMAL callCC #-} -- | @since 2.3.1 -#ifdef __MHS__ --- The ContT type is not polykinded with mhs. instance MonadCont (ContT r m) where -#else -instance forall k (r :: k) (m :: (k -> Type)) . MonadCont (ContT r m) where -#endif callCC = ContT.callCC -- --------------------------------------------------------------------------- diff --git a/mtl.cabal b/mtl.cabal index 0fcd9d3..1d19a37 100644 --- a/mtl.cabal +++ b/mtl.cabal @@ -24,7 +24,9 @@ extra-source-files: extra-doc-files: CHANGELOG.markdown -tested-with: GHC ==8.10 || ==9.2 || ==9.8 || ==9.10 || ==9.12, MHS ==0.14.15.0 +tested-with: + , GHC ==8.10 || ==9.2 || ==9.8 || ==9.10 || ==9.12 || ==9.14 + , MHS ==0.16.0.0 source-repository head type: git @@ -67,3 +69,10 @@ Library -Wmissing-export-lists default-language: Haskell2010 + +test-suite MonadCont + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: MonadCont.hs + default-language: Haskell2010 + build-depends: base, mtl, transformers diff --git a/test/MonadCont.hs b/test/MonadCont.hs new file mode 100644 index 0000000..c657ab8 --- /dev/null +++ b/test/MonadCont.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DataKinds #-} + +{-# OPTIONS_GHC -Wno-unused-binds #-} + +module Main (main) where + +import Control.Monad.Trans.Cont (ContT) +import Control.Monad.Cont.Class (MonadCont (callCC)) +import Data.Proxy (Proxy) + +#ifdef __GLASGOW_HASKELL__ +-- Test that MonadCont is possible with polykinded ContT +x :: (ContT 42 Proxy) () +x = callCC $ \_ -> return () +#endif + +main :: IO () +main = return ()