diff options
author | Tom Smeding <tom@tomsmeding.com> | 2023-07-09 16:22:47 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2023-07-09 16:22:47 +0200 |
commit | b3da0f16b5e47732bc1b2d632088830dab87a77d (patch) | |
tree | 413dd2f53da910f72eb6fe1e3ea31ffbb2aa25c4 /src/System/IO/Terminal/Input.hs | |
parent | 8418014253e3f5507dccfd4b7ef61c4402d6e0a6 (diff) |
Diffstat (limited to 'src/System/IO/Terminal/Input.hs')
-rw-r--r-- | src/System/IO/Terminal/Input.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/System/IO/Terminal/Input.hs b/src/System/IO/Terminal/Input.hs index 86db30d..efacf4f 100644 --- a/src/System/IO/Terminal/Input.hs +++ b/src/System/IO/Terminal/Input.hs @@ -1,5 +1,9 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving, FlexibleInstances #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE DerivingVia #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE StandaloneDeriving #-} {-| Module : System.IO.Terminal.Input Copyright : (c) UU, 2019 @@ -20,6 +24,7 @@ module System.IO.Terminal.Input ,InfInt(..), readKey) where +import Control.Monad.IO.Unlift (MonadUnliftIO) import Control.Monad.Trans import Control.Monad.State.Strict import Data.Maybe @@ -29,6 +34,7 @@ import System.IO.Terminal.Input.Key import System.IO.Terminal.Input.SeqParser -- import qualified Utils.Debug as Debug import Utils.Time +import Utils.Monad #if defined(OS_LINUX) || defined(OS_MACOS) import System.IO.Terminal.Input.Posix @@ -45,7 +51,8 @@ gEscTimeoutMS = 100 -- | The keyboard input monad transformer. The contained monad must be -- a monad over 'IO'. newtype InputT m a = InputT (StateT InputState m a) - deriving (Functor, Applicative, Monad, MonadState InputState, MonadTrans) + deriving newtype (Functor, Applicative, Monad, MonadState InputState, MonadTrans) + deriving MonadUnliftIO via StateTUnliftIOWrapper InputState m deriving instance MonadIO m => MonadIO (InputT m) |