urbit/pkg/hs/urbit-king/lib/Urbit/Vere/Term/Render.hs

33 lines
677 B
Haskell
Raw Normal View History

{-|
Terminal Driver
-}
module Urbit.Vere.Term.Render
( clearScreen
2020-02-19 19:01:51 +03:00
, clearLine
, cursorRight
, cursorLeft
, soundBell
) where
import Urbit.Prelude
import qualified System.Console.ANSI as ANSI
-- Types -----------------------------------------------------------------------
clearScreen :: MonadIO m => m ()
clearScreen = liftIO $ ANSI.clearScreen
2020-02-19 19:01:51 +03:00
clearLine :: MonadIO m => m ()
clearLine = liftIO $ ANSI.clearLine
2020-02-19 19:01:51 +03:00
soundBell :: MonadIO m => m ()
soundBell = liftIO $ putStr "\a"
2020-02-19 19:01:51 +03:00
cursorLeft :: MonadIO m => Int -> m ()
cursorLeft = liftIO . ANSI.cursorBackward
2020-02-19 19:01:51 +03:00
cursorRight :: MonadIO m => Int -> m ()
cursorRight = liftIO . ANSI.cursorForward