From b62dafd3ef1a9a7de6c51eb8e1d10c76fc1cecbb Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Wed, 7 Apr 2021 18:27:00 -0400 Subject: [PATCH] GHC 9 support. Apparently something in the typechecker got more ornery, because passing the actions to `mask_` and `uninterruptibleMask_` using `const` produced an error about not being able to instantiate unification variables with polytypes. --- ChangeLog.md | 5 ++++- fused-effects-exceptions.cabal | 3 ++- src/Control/Effect/Exception.hs | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 1daaeee..770e3fa 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,8 +1,11 @@ +# 1.1.0.1 + +* GHC 9 support. + # 1.1.0.0 * Port to fused-effects 1.1. - # 1.0.0.0 * Port to fused-effects 1.0. diff --git a/fused-effects-exceptions.cabal b/fused-effects-exceptions.cabal index 8557930..095de32 100644 --- a/fused-effects-exceptions.cabal +++ b/fused-effects-exceptions.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 name: fused-effects-exceptions -version: 1.1.0.0 +version: 1.1.0.1 synopsis: Handle exceptions thrown in IO with fused-effects. description: Provides Resource and Catch effects capable of reacting to and catching GHC's dynamic exceptions. homepage: https://github.com/fused-effects/fused-effects-exceptions#readme @@ -22,6 +22,7 @@ tested-with: GHC == 8.6.5 GHC == 8.8.3 GHC == 8.10.1 + GHC == 9.0.1 common common default-language: Haskell2010 diff --git a/src/Control/Effect/Exception.hs b/src/Control/Effect/Exception.hs index 9978fac..947a5b9 100644 --- a/src/Control/Effect/Exception.hs +++ b/src/Control/Effect/Exception.hs @@ -166,7 +166,7 @@ mask with = liftWith $ \ run ctx -> Exc.mask $ \ restore -> -- -- @since 1.0.0.0 mask_ :: Has (Lift IO) sig m => m a -> m a -mask_ m = mask $ const m +mask_ m = mask (\_ -> m) -- | See @"Control.Exception".'Exc.uninterruptibleMask'@. -- @@ -179,7 +179,7 @@ uninterruptibleMask with = liftWith $ \ run ctx -> Exc.uninterruptibleMask $ \ r -- -- @since 1.0.0.0 uninterruptibleMask_ :: Has (Lift IO) sig m => m a -> m a -uninterruptibleMask_ m = uninterruptibleMask $ const m +uninterruptibleMask_ m = uninterruptibleMask (\_ -> m) -- | See @"Control.Exception".'Exc.getMaskingState'@. --