2020-02-15 11:21:55 +03:00
|
|
|
{-|
|
|
|
|
Terminal Driver
|
|
|
|
-}
|
|
|
|
module Urbit.Vere.Term.Render
|
2020-03-23 23:35:50 +03:00
|
|
|
( clearScreen
|
2020-02-19 19:01:51 +03:00
|
|
|
, clearLine
|
|
|
|
, cursorRight
|
|
|
|
, cursorLeft
|
|
|
|
, soundBell
|
2020-02-15 11:21:55 +03:00
|
|
|
) where
|
|
|
|
|
|
|
|
import ClassyPrelude
|
|
|
|
|
2020-03-23 23:35:50 +03:00
|
|
|
import qualified System.Console.ANSI as ANSI
|
2020-02-15 11:21:55 +03:00
|
|
|
|
|
|
|
|
2020-02-19 19:27:23 +03:00
|
|
|
-- Types -----------------------------------------------------------------------
|
2020-02-15 11:21:55 +03:00
|
|
|
|
2020-02-19 19:27:23 +03:00
|
|
|
clearScreen ∷ MonadIO m ⇒ m ()
|
|
|
|
clearScreen = liftIO $ ANSI.clearScreen
|
2020-02-19 19:01:51 +03:00
|
|
|
|
2020-02-19 19:27:23 +03:00
|
|
|
clearLine ∷ MonadIO m ⇒ m ()
|
|
|
|
clearLine = liftIO $ ANSI.clearLine
|
2020-02-19 19:01:51 +03:00
|
|
|
|
2020-02-19 19:27:23 +03:00
|
|
|
soundBell ∷ MonadIO m ⇒ m ()
|
|
|
|
soundBell = liftIO $ putStr "\a"
|
2020-02-19 19:01:51 +03:00
|
|
|
|
2020-02-19 19:27:23 +03:00
|
|
|
cursorLeft ∷ MonadIO m ⇒ Int → m ()
|
|
|
|
cursorLeft = liftIO . ANSI.cursorBackward
|
2020-02-19 19:01:51 +03:00
|
|
|
|
2020-02-19 19:27:23 +03:00
|
|
|
cursorRight ∷ MonadIO m ⇒ Int → m ()
|
|
|
|
cursorRight = liftIO . ANSI.cursorForward
|