diff --git a/System/Console/Haskeline.hs b/System/Console/Haskeline.hs index f42277b..f5cae1c 100644 --- a/System/Console/Haskeline.hs +++ b/System/Console/Haskeline.hs @@ -33,6 +33,7 @@ module System.Console.Haskeline( runInputT, haveTerminalUI, mapInputT, + mapInputT_, -- ** Behaviors Behavior, runInputTBehavior, diff --git a/System/Console/Haskeline/InputT.hs b/System/Console/Haskeline/InputT.hs index d8849b9..737e71d 100644 --- a/System/Console/Haskeline/InputT.hs +++ b/System/Console/Haskeline/InputT.hs @@ -189,6 +189,11 @@ mapInputT f = InputT . mapReaderT (mapReaderT (mapReaderT (mapReaderT (mapReaderT f)))) . unInputT +mapInputT_ :: (m () -> m ()) -> InputT m () -> InputT m () +mapInputT_ f = InputT . mapReaderT (mapReaderT (mapReaderT + (mapReaderT (mapReaderT f)))) + . unInputT + -- | Read input from 'stdin'. -- Use terminal-style interaction if 'stdin' is connected to -- a terminal and has echoing enabled. Otherwise (e.g., if 'stdin' is a pipe), use