Skip to content

Use th-abstraction to make GHC 9.0.1 compatible #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sdl2-image.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/SDL/Raw/Helper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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