Skip to content

Commit f04e8fc

Browse files
committed
chore: clean up
1 parent b1b7cd4 commit f04e8fc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/SDL/Input/GameController.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import Control.Monad.Trans.Maybe (runMaybeT)
4242
import Data.Data (Data)
4343
import Data.Int
4444
import Data.Text (Text)
45-
import Data.Traversable (for)
4645
import Data.Typeable
4746
import Data.Word
4847
import Foreign.C (withCString)
@@ -85,10 +84,10 @@ data ControllerDevice = ControllerDevice
8584
See @<https://wiki.libsdl.org/SDL2/SDL_IsGameController SDL_IsGameController>@ for C documentation.
8685
-}
8786
isGameController :: MonadIO m => JoystickIndex -> m Bool
88-
isGameController = Raw.isGameController . fromIntegral
87+
isGameController = Raw.isGameController
8988

90-
{- | Create a 'ControllerDevice' from a 'Raw.JoystickID'. Returns 'Nothing' if
91-
the 'Raw.JoystickID' does not support the game controller interface.
89+
{- | Create a 'ControllerDevice' from a 'JoystickIndex'. Returns 'Nothing' if
90+
the 'JoystickIndex' does not support the game controller interface.
9291
-}
9392
mkControllerDevice :: MonadIO m => JoystickIndex -> m (Maybe ControllerDevice)
9493
mkControllerDevice i = runMaybeT $ do
@@ -102,7 +101,7 @@ mkControllerDevice i = runMaybeT $ do
102101
mkControllerDevice' :: MonadIO m => JoystickIndex -> m ControllerDevice
103102
mkControllerDevice' i = do
104103
cstr <- liftIO $
105-
throwIfNull "SDL.Input.Controller.availableGameControllers" "SDL_GameControllerNameForIndex" $
104+
throwIfNull "SDL.Input.GameController.mkControllerDevice'" "SDL_GameControllerNameForIndex" $
106105
Raw.gameControllerNameForIndex (fromIntegral i)
107106
name <- liftIO $ Text.decodeUtf8 <$> BS.packCString cstr
108107
return (ControllerDevice name i)

0 commit comments

Comments
 (0)