hscolour-1.25: Colourise Haskell code.

Safe Haskell | Safe-Inferred
Language | Haskell98

Language.Haskell.HsColour.ANSI

Contents

- Orphan instances

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 :: String
- clearbol :: String
- clearline :: String
- clearDown :: String
- clearUp :: String
- cls :: String
- goto :: Int -> Int -> String
- cursorUp :: String
- cursorDown :: String
- cursorLeft :: String
- cursorRight :: String
- savePosition :: String
- restorePosition :: String
- 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 :: String #

clearbol :: String #

clearline :: String #

clearDown :: String #

clearUp :: String #

cls :: String #

Clear the screen.

goto :: Int -> Int -> String #

Move the screen cursor to the given position.

cursorUp :: String #

cursorDown :: String #

cursorLeft :: String #

cursorRight :: String #

savePosition :: String #

restorePosition :: String #

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

Instances details

Enum Highlight # |

Instance details

Defined in Language.Haskell.HsColour.ANSI

Methods

succ :: Highlight -> Highlight #

pred :: Highlight -> Highlight #

toEnum :: Int -> Highlight #

fromEnum :: Highlight -> Int #

enumFrom :: Highlight -> [Highlight] #

enumFromThen :: Highlight -> Highlight -> [Highlight] #

enumFromTo :: Highlight -> Highlight -> [Highlight] #

enumFromThenTo :: Highlight -> Highlight -> Highlight -> [Highlight] #

Read Highlight # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods readsPrec :: Int -> ReadS Highlight # readList :: ReadS [Highlight] # readPrec :: ReadPrec Highlight # readListPrec :: ReadPrec [Highlight] #
Show Highlight # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods showsPrec :: Int -> Highlight -> ShowS # show :: Highlight -> String # showList :: [Highlight] -> ShowS #
Eq Highlight # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods (==) :: Highlight -> Highlight -> Bool # (/=) :: Highlight -> Highlight -> Bool #

data Colour #

Colours supported by ANSI codes.

Constructors

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

#### Instances

Instances details

Enum Colour # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods succ :: Colour -> Colour # pred :: Colour -> Colour # toEnum :: Int -> Colour # fromEnum :: Colour -> Int # enumFrom :: Colour -> [Colour] # enumFromThen :: Colour -> Colour -> [Colour] # enumFromTo :: Colour -> Colour -> [Colour] # enumFromThenTo :: Colour -> Colour -> Colour -> [Colour] #
Read Colour # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods readsPrec :: Int -> ReadS Colour # readList :: ReadS [Colour] # readPrec :: ReadPrec Colour # readListPrec :: ReadPrec [Colour] #
Show Colour # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods showsPrec :: Int -> Colour -> ShowS # show :: Colour -> String # showList :: [Colour] -> ShowS #
Eq Colour # |
Instance details Defined in Language.Haskell.HsColour.ColourHighlight Methods (==) :: Colour -> Colour -> Bool # (/=) :: Colour -> Colour -> Bool #

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

Instances details

Show TerminalType # |
Instance details Defined in Language.Haskell.HsColour.Output Methods showsPrec :: Int -> TerminalType -> ShowS # show :: TerminalType -> String # showList :: [TerminalType] -> ShowS #
Eq TerminalType # |
Instance details Defined in Language.Haskell.HsColour.Output Methods (==) :: TerminalType -> TerminalType -> Bool # (/=) :: TerminalType -> TerminalType -> Bool #
Ord TerminalType # |

Instance details

Defined in Language.Haskell.HsColour.Output

Methods

compare :: TerminalType -> TerminalType -> Ordering #

(<) :: TerminalType -> TerminalType -> Bool #

(<=) :: TerminalType -> TerminalType -> Bool #

(>) :: TerminalType -> TerminalType -> Bool #

(>=) :: TerminalType -> TerminalType -> Bool #

max :: TerminalType -> TerminalType -> TerminalType #

min :: TerminalType -> TerminalType -> TerminalType #

# Orphan instances

Enum Highlight # |
Instance details Methods succ :: Highlight -> Highlight # pred :: Highlight -> Highlight # toEnum :: Int -> Highlight # fromEnum :: Highlight -> Int # enumFrom :: Highlight -> [Highlight] # enumFromThen :: Highlight -> Highlight -> [Highlight] # enumFromTo :: Highlight -> Highlight -> [Highlight] # enumFromThenTo :: Highlight -> Highlight -> Highlight -> [Highlight] #