From b3da0f16b5e47732bc1b2d632088830dab87a77d Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 9 Jul 2023 16:22:47 +0200 Subject: Handling of SIGWINCH (and some maintenance) --- src/System/IO/Terminal/Input.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/System/IO/Terminal/Input.hs') 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) -- cgit v1.2.3-70-g09d2