Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > 1a0a9aa47daf41bc521ed937fa412a6d > files > 20

ghc-ansi-terminal-devel-0.5.5.1-1.fc17.i686.rpm

-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Simple ANSI terminal support, with Windows compatibility
--   
--   ANSI terminal support for Haskell: allows cursor movement, screen
--   clearing, color output showing or hiding the cursor, and changing the
--   title. Compatible with Windows and those Unixes with ANSI terminals,
--   but only GHC is supported as a compiler.
@package ansi-terminal
@version 0.5.5.1


-- | Provides ANSI terminal support for Windows and ANSI terminal software
--   running on a Unix-like operating system.
--   
--   The ANSI escape codes are described at
--   <a>http://en.wikipedia.org/wiki/ANSI_escape_code</a> and provide a
--   rich range of functionality for terminal control, which includes:
--   
--   <ul>
--   <li>Colored text output, with control over both foreground and
--   background colors</li>
--   <li>Hiding or showing the cursor</li>
--   <li>Moving the cursor around</li>
--   <li>Clearing parts of the screen</li>
--   </ul>
--   
--   The most frequently used parts of this ANSI command set are exposed
--   with a platform independent interface by this module. Every function
--   exported comes in three flavours:
--   
--   <ul>
--   <li>Vanilla: has an <tt>IO ()</tt> type and doesn't take a
--   <tt>Handle</tt>. This just outputs the ANSI command directly on to the
--   terminal corresponding to stdout. Commands issued like this should
--   work as you expect on both Windows and Unix.</li>
--   <li>Chocolate: has an <tt>IO ()</tt> type but takes a <tt>Handle</tt>.
--   This outputs the ANSI command on the terminal corresponding to the
--   supplied handle. Commands issued like this should also work as your
--   expect on both Windows and Unix.</li>
--   <li>Strawberry: has a <tt>String</tt> type and just consists of an
--   escape code which can be added to any other bit of text before being
--   output. This version of the API is often convenient to use, but due to
--   fundamental limitations in Windows ANSI terminal support will only
--   work on Unix. On Windows these codes will always be the empty string,
--   so it is possible to use them portably for e.g. coloring console
--   output on the understanding that you will only see colors if you are
--   running on a Unix-like operating system.</li>
--   </ul>
module System.Console.ANSI

-- | ANSI colors: come in various intensities, which are controlled by
--   <a>ColorIntensity</a>
data Color
Black :: Color
Red :: Color
Green :: Color
Yellow :: Color
Blue :: Color
Magenta :: Color
Cyan :: Color
White :: Color

-- | ANSI colors come in two intensities
data ColorIntensity
Dull :: ColorIntensity
Vivid :: ColorIntensity

-- | ANSI colors can be set on two different layers
data ConsoleLayer
Foreground :: ConsoleLayer
Background :: ConsoleLayer

-- | ANSI blink speeds: values other than <a>NoBlink</a> are not widely
--   supported
data BlinkSpeed

-- | Less than 150 blinks per minute
SlowBlink :: BlinkSpeed

-- | More than 150 blinks per minute
RapidBlink :: BlinkSpeed
NoBlink :: BlinkSpeed

-- | ANSI text underlining
data Underlining
SingleUnderline :: Underlining

-- | Not widely supported
DoubleUnderline :: Underlining
NoUnderline :: Underlining

-- | ANSI general console intensity: usually treated as setting the font
--   style (e.g. <a>BoldIntensity</a> causes text to be bold)
data ConsoleIntensity
BoldIntensity :: ConsoleIntensity

-- | Not widely supported: sometimes treated as concealing text
FaintIntensity :: ConsoleIntensity
NormalIntensity :: ConsoleIntensity

-- | ANSI Select Graphic Rendition command
data SGR
Reset :: SGR
SetConsoleIntensity :: ConsoleIntensity -> SGR

-- | Not widely supported: sometimes treated as swapping foreground and
--   background
SetItalicized :: Bool -> SGR
SetUnderlining :: Underlining -> SGR
SetBlinkSpeed :: BlinkSpeed -> SGR

-- | Not widely supported
SetVisible :: Bool -> SGR
SetSwapForegroundBackground :: Bool -> SGR
SetColor :: ConsoleLayer -> ColorIntensity -> Color -> SGR
cursorUp :: Int -> IO ()
cursorDown :: Int -> IO ()
cursorForward :: Int -> IO ()
cursorBackward :: Int -> IO ()
hCursorUp :: Handle -> Int -> IO ()

-- | Thanks to Brandon S. Allbery and Curt Sampson for pointing me in the
--   right direction on xterm title setting on haskell-cafe. The <a>0</a>
--   signifies that both the title and <a>icon</a> text should be set: i.e.
--   the text for the window in the Start bar (or similar) as well as that
--   in the actual window title. This is chosen for consistent behaviour
--   between Unixes and Windows.
hCursorDown :: Handle -> Int -> IO ()
hCursorForward :: Handle -> Int -> IO ()
hCursorBackward :: Handle -> Int -> IO ()
cursorUpCode :: Int -> String
cursorDownCode :: Int -> String
cursorForwardCode :: Int -> String
cursorBackwardCode :: Int -> String
cursorUpLine :: Int -> IO ()
cursorDownLine :: Int -> IO ()
hCursorUpLine :: Handle -> Int -> IO ()
hCursorDownLine :: Handle -> Int -> IO ()
cursorUpLineCode :: Int -> String
cursorDownLineCode :: Int -> String
setCursorColumn :: Int -> IO ()
hSetCursorColumn :: Handle -> Int -> IO ()
setCursorColumnCode :: Int -> String
setCursorPosition :: Int -> Int -> IO ()
hSetCursorPosition :: Handle -> Int -> Int -> IO ()
setCursorPositionCode :: Int -> Int -> String
clearFromCursorToScreenEnd :: IO ()
clearFromCursorToScreenBeginning :: IO ()
clearScreen :: IO ()
hClearFromCursorToScreenEnd :: Handle -> IO ()
hClearFromCursorToScreenBeginning :: Handle -> IO ()
hClearScreen :: Handle -> IO ()
clearFromCursorToScreenEndCode :: String
clearFromCursorToScreenBeginningCode :: String
clearScreenCode :: String
clearFromCursorToLineEnd :: IO ()
clearFromCursorToLineBeginning :: IO ()
clearLine :: IO ()
hClearFromCursorToLineEnd :: Handle -> IO ()
hClearFromCursorToLineBeginning :: Handle -> IO ()
hClearLine :: Handle -> IO ()
clearFromCursorToLineEndCode :: String
clearFromCursorToLineBeginningCode :: String
clearLineCode :: String
scrollPageUp :: Int -> IO ()

-- | Scroll the displayed information up or down the terminal: not widely
--   supported
scrollPageDown :: Int -> IO ()
hScrollPageUp :: Handle -> Int -> IO ()

-- | Scroll the displayed information up or down the terminal: not widely
--   supported
hScrollPageDown :: Handle -> Int -> IO ()
scrollPageUpCode :: Int -> String

-- | Scroll the displayed information up or down the terminal: not widely
--   supported
scrollPageDownCode :: Int -> String

-- | Set the Select Graphic Rendition mode
setSGR :: [SGR] -> IO ()

-- | Set the Select Graphic Rendition mode
hSetSGR :: Handle -> [SGR] -> IO ()

-- | Set the Select Graphic Rendition mode
setSGRCode :: [SGR] -> String
hideCursor :: IO ()
showCursor :: IO ()
hHideCursor :: Handle -> IO ()
hShowCursor :: Handle -> IO ()
hideCursorCode :: String
showCursorCode :: String

-- | Set the terminal window title
setTitle :: String -> IO ()

-- | Set the terminal window title
hSetTitle :: Handle -> String -> IO ()

-- | Set the terminal window title
setTitleCode :: String -> String