diff options
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) |