Skip to content

Commit ed14c60

Browse files
authored
Set Int -> IntSet (#1097)
1 parent dfe83f7 commit ed14c60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Miso/Subscription/Keyboard.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ module Miso.Subscription.Keyboard
2222
-----------------------------------------------------------------------------
2323
import Control.Monad.IO.Class
2424
import Data.IORef
25-
import Data.Set
26-
import qualified Data.Set as S
25+
import Data.IntSet
26+
import qualified Data.IntSet as S
2727
import Language.Javascript.JSaddle hiding (new)
2828
-----------------------------------------------------------------------------
2929
import Miso.Effect (Sub)
@@ -43,7 +43,7 @@ data Arrows
4343
-----------------------------------------------------------------------------
4444
-- | Helper function to convert keys currently pressed to @Arrows@, given a
4545
-- mapping for keys representing up, down, left and right respectively.
46-
toArrows :: ([Int], [Int], [Int], [Int]) -> Set Int -> Arrows
46+
toArrows :: ([Int], [Int], [Int], [Int]) -> IntSet -> Arrows
4747
toArrows (up, down, left, right) set' = Arrows
4848
{ arrowX =
4949
case (check left, check right) of
@@ -75,7 +75,7 @@ directionSub dirs = keyboardSub . (. toArrows dirs)
7575
-----------------------------------------------------------------------------
7676
-- | Returns subscription for Keyboard.
7777
-- The callback will be called with the Set of currently pressed @keyCode@s.
78-
keyboardSub :: (Set Int -> action) -> Sub action
78+
keyboardSub :: (IntSet -> action) -> Sub action
7979
keyboardSub f sink = do
8080
keySetRef <- liftIO (newIORef mempty)
8181
FFI.windowAddEventListener "keyup" $ keyUpCallback keySetRef

0 commit comments

Comments
 (0)