From 8efac05f1e02e703e5daacdb9708ca582467f9cd Mon Sep 17 00:00:00 2001 From: Steven Shuck Date: Sun, 7 Jun 2026 11:37:25 -0400 Subject: [PATCH 1/4] Git ignore stack.yaml and stack.yaml.lock --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 55a715d..2ef1005 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ cabal.sandbox.config *.hp *.eventlog .stack-work/ +stack.yaml* cabal.project.local* .HTF/ .ghc.environment.* From e8d5c1c002b8ec18cda1cb969c601c09dff9182d Mon Sep 17 00:00:00 2001 From: Steven Shuck Date: Sun, 7 Jun 2026 11:51:54 -0400 Subject: [PATCH 2/4] Bump MHS to 0.16.0.0 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ca46c8..0988e53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,7 +171,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - mhs: ["0.15.4.0"] + mhs: ["0.16.0.0"] fail-fast: false steps: - name: checkout mhs repo From 200f6c3b04a5bbf32e5567d43cee618e1bbc4ea8 Mon Sep 17 00:00:00 2001 From: Steven Shuck Date: Sun, 7 Jun 2026 13:14:42 -0400 Subject: [PATCH 3/4] Git ignore dist-mcabal (MHS) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2ef1005..bcca8b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ dist dist-boot dist-install +dist-mcabal dist-newstyle ghc.mk GNUmakefile From 120e91dcd5f2e67cf927dcbef22f99bf03cf725e Mon Sep 17 00:00:00 2001 From: Steven Shuck Date: Mon, 8 Jun 2026 05:27:44 -0400 Subject: [PATCH 4/4] Remove CPP for ContT MonadCont instance; update tested-with The kind signature does not work in MHS, and it isn't necessary in GHC, so delete it. Test for the latter. --- .github/workflows/ci.yml | 15 ++++++++++++--- Control/Monad/Cont/Class.hs | 5 ----- mtl.cabal | 11 ++++++++++- test/MonadCont.hs | 19 +++++++++++++++++++ 4 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 test/MonadCont.hs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0988e53..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,6 +166,10 @@ jobs: # build stack build + - name: Test + run: | + stack test + mhs: name: "MicroHS ${{ matrix.mhs }}" runs-on: ubuntu-latest @@ -196,3 +200,8 @@ jobs: run: | cd mtl mcabal -r install + + - name: test + run: | + cd mtl + mcabal test 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 ()