From 1ee72e190b24fe5aa4b9112a3784410d11db130a Mon Sep 17 00:00:00 2001 From: nxths Date: Sun, 30 Jan 2022 15:49:20 -0800 Subject: [PATCH] Use th-abstraction to make GHC 9.0.1 compatible --- sdl2-image.cabal | 3 ++- src/SDL/Raw/Helper.hs | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sdl2-image.cabal b/sdl2-image.cabal index 47287f4..9b31865 100644 --- a/sdl2-image.cabal +++ b/sdl2-image.cabal @@ -37,7 +37,8 @@ library bytestring >= 0.10.4.0, sdl2 >= 2.0, text >= 1.1.0.0, - template-haskell + template-haskell, + th-abstraction >= 0.4.0.0 default-language: Haskell2010 diff --git a/src/SDL/Raw/Helper.hs b/src/SDL/Raw/Helper.hs index 1eccb77..35b8f64 100644 --- a/src/SDL/Raw/Helper.hs +++ b/src/SDL/Raw/Helper.hs @@ -17,9 +17,10 @@ inlined MonadIO variant. Use this to simplify the package's SDL.Raw.* modules. module SDL.Raw.Helper (liftF) where -import Control.Monad (replicateM) -import Control.Monad.IO.Class (MonadIO, liftIO) +import Control.Monad (replicateM) +import Control.Monad.IO.Class (MonadIO, liftIO) import Language.Haskell.TH +import Language.Haskell.TH.Datatype.TyVarBndr (plainTVSpecified) -- | Given a name @fname@, a name of a C function @cname@ and the desired -- Haskell type @ftype@, this function generates: @@ -81,7 +82,7 @@ liftType = \case m <- newName "m" return $ ForallT - [PlainTV m] + [plainTVSpecified m] [AppT (ConT ''MonadIO) $ VarT m] (AppT (VarT m) t) t -> return t