summaryrefslogtreecommitdiff
path: root/src/System/IO/Terminal.hs
blob: 0846d9fc806e6e6d84e8dad91f12ba78b5030f8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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