on master help sign in
NFData instance for Event
commita6c346b410df61871f3544064540e425646e93f6 authorMario Lang <mlang@blind.guru> dateFri 16 Jul 2021, 13:59 (5 years ago) parentabf7fc4
1 file changed+9
src/Graphics/Vty/Input/Events.hs+9
src/Graphics/Vty/Input/Events.hs+9
@@ -1,6 +1,7 @@
11{-# Language DeriveGeneric #-}
22module Graphics.Vty.Input.Events where
33
4+import Control.DeepSeq
45import Data.ByteString
56import GHC.Generics
67
@@ -21,16 +22,22 @@ data Key = KEsc | KChar Char | KBS | KEnter
2122 | KHome | KPageUp | KDel | KEnd | KPageDown | KBegin | KMenu
2223 deriving (Eq,Show,Read,Ord,Generic)
2324
25+instance NFData Key
26+
2427-- | Modifier keys. Key codes are interpreted such that users are more
2528-- likely to have Meta than Alt; for instance on the PC Linux console,
2629-- 'MMeta' will generally correspond to the physical Alt key.
2730data Modifier = MShift | MCtrl | MMeta | MAlt
2831 deriving (Eq,Show,Read,Ord,Generic)
2932
33+instance NFData Modifier
34+
3035-- | Mouse buttons.
3136data Button = BLeft | BMiddle | BRight | BScrollUp | BScrollDown
3237 deriving (Eq,Show,Read,Ord,Generic)
3338
39+instance NFData Button
40+
3441-- | Events.
3542data Event
3643 = EvKey Key [Modifier]
@@ -62,4 +69,6 @@ data Event
6269 -- ^ The terminal running the application gained input focus.
6370 deriving (Eq,Show,Read,Ord,Generic)
6471
72+instance NFData Event
73+
6574type ClassifyMap = [(String,Event)]