Skip to content
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

Replace monad-control/lifted-base with unliftio #10

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
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Upcoming
=======

* Replace `monad-control` and `lifted-base` dependencies with `unliftio-core`
and `unliftio`
4 changes: 2 additions & 2 deletions sdl2-mixer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ library
base >= 4.7 && < 5,
bytestring >= 0.10.4.0,
data-default-class >= 0.0.1,
lifted-base >= 0.2,
monad-control >= 1.0,
sdl2 >= 2.0.0,
template-haskell,
unliftio-core,
unliftio,
vector >= 0.10

default-language:
Expand Down
6 changes: 3 additions & 3 deletions src/SDL/Mixer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,9 @@ module SDL.Mixer
) where

import Control.Exception (throwIO)
import Control.Exception.Lifted (finally)
import Control.Monad (void, forM, when)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Trans.Control (MonadBaseControl)
import Control.Monad.IO.Unlift (MonadUnliftIO)
import Data.Bits ((.|.), (.&.))
import Data.ByteString (ByteString, readFile)
import Data.ByteString.Unsafe (unsafeUseAsCStringLen)
Expand All @@ -192,6 +191,7 @@ import SDL (SDLException(SDLCallFailed))
import SDL.Internal.Exception
import SDL.Raw.Filesystem (rwFromConstMem)
import System.IO.Unsafe (unsafePerformIO)
import UnliftIO.Exception (finally)

import qualified SDL.Raw
import qualified SDL.Raw.Mixer
Expand Down Expand Up @@ -243,7 +243,7 @@ version = liftIO $ do
--
-- Automatically cleans up the API when the inner computation finishes.
withAudio
:: (MonadBaseControl IO m, MonadIO m) => Audio -> ChunkSize -> m a -> m a
:: MonadUnliftIO m => Audio -> ChunkSize -> m a -> m a
withAudio conf csize act = do
openAudio conf csize
finally act closeAudio
Expand Down