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 Source #

highlightOn :: [Highlight] -> String Source #

# `highlightOn` `Ansi16Colour`

highlightOff :: [Char] Source #

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

Make the given string appear with all of the listed highlights

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

# `highlightG` `Ansi16Colour`

cleareol :: String Source #

clearbol :: String Source #

clearline :: String Source #

clearDown :: String Source #

clearUp :: String Source #

cls :: String Source #

Clear the screen.

goto :: Int -> Int -> String Source #

Move the screen cursor to the given position.

cursorUp :: String Source #

cursorDown :: String Source #

cursorLeft :: String Source #

cursorRight :: String Source #

savePosition :: String Source #

restorePosition :: String Source #

data Highlight Source #

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 Source # |

Instance details

Defined in Language.Haskell.HsColour.ANSI

Methods

succ :: Highlight -> Highlight Source #

pred :: Highlight -> Highlight Source #

toEnum :: Int -> Highlight Source #

fromEnum :: Highlight -> Int Source #

enumFrom :: Highlight -> [Highlight] Source #

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

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

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

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

data Colour Source #

Colours supported by ANSI codes.

Constructors

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

#### Instances

Instances details

Enum Colour Source # |

Instance details

Defined in Language.Haskell.HsColour.ColourHighlight

Methods

succ :: Colour -> Colour Source #

pred :: Colour -> Colour Source #

toEnum :: Int -> Colour Source #

fromEnum :: Colour -> Int Source #

enumFrom :: Colour -> [Colour] Source #

enumFromThen :: Colour -> Colour -> [Colour] Source #

enumFromTo :: Colour -> Colour -> [Colour] Source #

enumFromThenTo :: Colour -> Colour -> Colour -> [Colour] Source #

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

colourCycle :: [Colour] Source #

An infinite supply of colours.

enableScrollRegion :: Int -> Int -> String Source #

Scrolling

scrollUp :: String Source #

scrollDown :: String Source #

lineWrap :: Bool -> [Char] Source #

data TerminalType Source #

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

Instance details

Defined in Language.Haskell.HsColour.Output

Methods

compare :: TerminalType -> TerminalType -> Ordering Source #

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

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

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

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

max :: TerminalType -> TerminalType -> TerminalType Source #

min :: TerminalType -> TerminalType -> TerminalType Source #

# Orphan instances

Enum Highlight Source # |

Instance details

Methods

succ :: Highlight -> Highlight Source #

pred :: Highlight -> Highlight Source #

toEnum :: Int -> Highlight Source #

fromEnum :: Highlight -> Int Source #

enumFrom :: Highlight -> [Highlight] Source #

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

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

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