Language.Haskell.HsColour.ANSI

hscolour-1.23: Colourise Haskell code.

Safe Haskell | Safe
Language | Haskell98

Language.Haskell.HsColour.ANSI

Description

Partially taken from Hugs AnsiScreen.hs library:

Synopsis

- highlightOnG :: TerminalType -> [Highlight] -> String
- highlightOn :: [Highlight] -> String
- highlightOff :: [Char]
- highlightG :: TerminalType -> [Highlight] -> String -> String
- highlight :: [Highlight] -> String -> String
- cleareol :: [Char]
- clearbol :: [Char]
- clearline :: [Char]
- clearDown :: [Char]
- clearUp :: [Char]
- cls :: String
- goto :: Int -> Int -> String
- cursorUp :: [Char]
- cursorDown :: [Char]
- cursorLeft :: [Char]
- cursorRight :: [Char]
- savePosition :: [Char]
- restorePosition :: [Char]
- data Highlight
  - = Normal
  - | Bold
  - | Dim
  - | Underscore
  - | Blink
  - | ReverseVideo
  - | Concealed
  - | Foreground Colour
  - | Background Colour
  - | Italic
- data Colour
  - = Black
  - | Red
  - | Green
  - | Yellow
  - | Blue
  - | Magenta
  - | Cyan
  - | White
  - | Rgb Word8 Word8 Word8
- colourCycle :: [Colour]
- enableScrollRegion :: Int -> Int -> String
- scrollUp :: String
- scrollDown :: String
- lineWrap :: Bool -> [Char]
- data TerminalType
  - = Ansi16Colour
  - | XTerm256Compatible

# Documentation

highlightOnG :: TerminalType -> [Highlight] -> String

highlightOn :: [Highlight] -> String

# `highlightOn` `Ansi16Colour`

highlightOff :: [Char]

highlightG :: TerminalType -> [Highlight] -> String -> String

Make the given string appear with all of the listed highlights

highlight :: [Highlight] -> String -> String

# `highlightG` `Ansi16Colour`

cleareol :: [Char]

clearbol :: [Char]

clearline :: [Char]

clearDown :: [Char]

clearUp :: [Char]

cls :: String

Clear the screen.

goto :: Int -> Int -> String

Move the screen cursor to the given position.

cursorUp :: [Char]

cursorDown :: [Char]

cursorLeft :: [Char]

cursorRight :: [Char]

savePosition :: [Char]

restorePosition :: [Char]

data Highlight

Types of highlighting supported by ANSI codes (and some extra styles).

Constructors

Normal |
Bold |
Dim |
Underscore |
Blink |
ReverseVideo |
Concealed |
Foreground Colour |
Background Colour |
Italic |

Instances

Eq Highlight |
Read Highlight |
Show Highlight |

data Colour

Colours supported by ANSI codes.

Constructors

Black |
Red |
Green |
Yellow |
Blue |
Magenta |
Cyan |
White |
Rgb Word8 Word8 Word8 |

Instances

Enum Colour |
Eq Colour |
Read Colour |
Show Colour |

colourCycle :: [Colour]

An infinite supply of colours.

enableScrollRegion :: Int -> Int -> String

Scrolling

scrollUp :: String

scrollDown :: String

lineWrap :: Bool -> [Char]

data TerminalType

Constructors

Ansi16Colour | `\033[Xm`-style escape sequences (with X =~ [34][0-7])
XTerm256Compatible | `Ansi16Colour`, and also `\033[Y8;5;Zm]`-style escape sequences (with Y =~ [3,4] and Z an integer in [0,255] with the XTerm colour cube semantics).

Instances

Eq TerminalType |
Ord TerminalType |
Show TerminalType |