summaryrefslogtreecommitdiff
path: root/src/System/IO/Terminal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/System/IO/Terminal.hs')
-rw-r--r--src/System/IO/Terminal.hs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/System/IO/Terminal.hs b/src/System/IO/Terminal.hs
new file mode 100644
index 0000000..0846d9f
--- /dev/null
+++ b/src/System/IO/Terminal.hs
@@ -0,0 +1,31 @@
+{-|
+Module : System.IO.Terminal
+Copyright : (c) UU, 2019
+License : MIT
+Maintainer : Tom Smeding
+Stability : experimental
+Portability : POSIX, macOS, Windows
+
+Top-level module for building an application using terminal I/O.
+
+The library is loosely modelled after the [termio](https://github.com/tomsmeding/termio)
+library for C. See the documentation of the re-exported modules for more
+information.
+-}
+module System.IO.Terminal
+ (module System.IO.Terminal.Input
+ ,module System.IO.Terminal.Render
+ ,TUI, withTUI)
+ where
+
+import Control.Monad.Trans
+import System.IO.Terminal.Input
+import System.IO.Terminal.Render
+
+
+-- | The monad for doing terminal I/O operations.
+type TUI = RenderT Input
+
+-- | Run a 'TUI' computation in the 'IO' monad.
+withTUI :: TUI a -> IO a
+withTUI = withInput . withRender