summaryrefslogtreecommitdiff
path: root/src/System/IO/Terminal.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2019-08-19 13:00:05 +0200
committertomsmeding <tom.smeding@gmail.com>2019-08-19 13:17:48 +0200
commit4e5590d148a7f2b517dce18c231b9d4cb0b1d19f (patch)
treedd04cecda1525f826f06752102ea2a58754fdbf7 /src/System/IO/Terminal.hs
Import of source files
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