safe-coloured-text-0.2.0.1: Safely output coloured text
Safe HaskellNone
LanguageHaskell2010

Text.Colour.Code

Synopsis

Documentation

newtype CSI Source #

Constructors

SGR [SGR] 

Instances

Instances details
Eq CSI Source # 
Instance details

Defined in Text.Colour.Code

Methods

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

(/=) :: CSI -> CSI -> Bool #

Show CSI Source # 
Instance details

Defined in Text.Colour.Code

Methods

showsPrec :: Int -> CSI -> ShowS #

show :: CSI -> String #

showList :: [CSI] -> ShowS #

Generic CSI Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep CSI :: Type -> Type #

Methods

from :: CSI -> Rep CSI x #

to :: Rep CSI x -> CSI #

Validity CSI Source # 
Instance details

Defined in Text.Colour.Code

Methods

validate :: CSI -> Validation #

type Rep CSI Source # 
Instance details

Defined in Text.Colour.Code

type Rep CSI = D1 ('MetaData "CSI" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'True) (C1 ('MetaCons "SGR" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SGR])))

renderCSIUtf8BS :: CSI -> ByteString Source #

Render a CSI directly to ByteString using UTF8.

You probably want to use renderCSI instead. This is just for testing.

renderCSIText :: CSI -> Text Source #

Render a CSI directly to strict Text.

You probably want to use renderCSI instead. This is just for testing.

renderCSILazyText :: CSI -> Text Source #

Render a CSI directly to lazy Text.

You probably want to use renderCSI instead. This is just for testing.

data SGR Source #

Instances

Instances details
Eq SGR Source # 
Instance details

Defined in Text.Colour.Code

Methods

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

(/=) :: SGR -> SGR -> Bool #

Show SGR Source # 
Instance details

Defined in Text.Colour.Code

Methods

showsPrec :: Int -> SGR -> ShowS #

show :: SGR -> String #

showList :: [SGR] -> ShowS #

Generic SGR Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep SGR :: Type -> Type #

Methods

from :: SGR -> Rep SGR x #

to :: Rep SGR x -> SGR #

Validity SGR Source # 
Instance details

Defined in Text.Colour.Code

Methods

validate :: SGR -> Validation #

type Rep SGR Source # 
Instance details

Defined in Text.Colour.Code

type Rep SGR = D1 ('MetaData "SGR" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'False) (((C1 ('MetaCons "Reset" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SetItalic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) :+: (C1 ('MetaCons "SetUnderlining" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Underlining)) :+: C1 ('MetaCons "SetBlinking" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Blinking)))) :+: ((C1 ('MetaCons "SetConsoleIntensity" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ConsoleIntensity)) :+: C1 ('MetaCons "SetColour" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ColourIntensity) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ConsoleLayer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TerminalColour)))) :+: (C1 ('MetaCons "Set8BitColour" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ConsoleLayer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8)) :+: C1 ('MetaCons "Set24BitColour" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ConsoleLayer) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8))))))

data Underlining Source #

ANSI text underlining

Instances

Instances details
Bounded Underlining Source # 
Instance details

Defined in Text.Colour.Code

Enum Underlining Source # 
Instance details

Defined in Text.Colour.Code

Eq Underlining Source # 
Instance details

Defined in Text.Colour.Code

Show Underlining Source # 
Instance details

Defined in Text.Colour.Code

Generic Underlining Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep Underlining :: Type -> Type #

Validity Underlining Source # 
Instance details

Defined in Text.Colour.Code

type Rep Underlining Source # 
Instance details

Defined in Text.Colour.Code

type Rep Underlining = D1 ('MetaData "Underlining" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'False) (C1 ('MetaCons "SingleUnderline" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DoubleUnderline" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NoUnderline" 'PrefixI 'False) (U1 :: Type -> Type)))

data Blinking Source #

ANSI text blinking

Instances

Instances details
Bounded Blinking Source # 
Instance details

Defined in Text.Colour.Code

Enum Blinking Source # 
Instance details

Defined in Text.Colour.Code

Eq Blinking Source # 
Instance details

Defined in Text.Colour.Code

Show Blinking Source # 
Instance details

Defined in Text.Colour.Code

Generic Blinking Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep Blinking :: Type -> Type #

Methods

from :: Blinking -> Rep Blinking x #

to :: Rep Blinking x -> Blinking #

Validity Blinking Source # 
Instance details

Defined in Text.Colour.Code

type Rep Blinking Source # 
Instance details

Defined in Text.Colour.Code

type Rep Blinking = D1 ('MetaData "Blinking" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'False) (C1 ('MetaCons "SlowBlinking" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RapidBlinking" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NoBlinking" 'PrefixI 'False) (U1 :: Type -> Type)))

data ConsoleIntensity Source #

ANSI general console intensity: usually treated as setting the font style (e.g. BoldIntensity causes text to be bold)

Instances

Instances details
Bounded ConsoleIntensity Source # 
Instance details

Defined in Text.Colour.Code

Enum ConsoleIntensity Source # 
Instance details

Defined in Text.Colour.Code

Eq ConsoleIntensity Source # 
Instance details

Defined in Text.Colour.Code

Show ConsoleIntensity Source # 
Instance details

Defined in Text.Colour.Code

Generic ConsoleIntensity Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep ConsoleIntensity :: Type -> Type #

Validity ConsoleIntensity Source # 
Instance details

Defined in Text.Colour.Code

type Rep ConsoleIntensity Source # 
Instance details

Defined in Text.Colour.Code

type Rep ConsoleIntensity = D1 ('MetaData "ConsoleIntensity" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'False) (C1 ('MetaCons "BoldIntensity" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FaintIntensity" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NormalIntensity" 'PrefixI 'False) (U1 :: Type -> Type)))

data ColourIntensity Source #

ANSI's standard colours come in two intensities

Constructors

Dull 
Bright 

Instances

Instances details
Bounded ColourIntensity Source # 
Instance details

Defined in Text.Colour.Code

Enum ColourIntensity Source # 
Instance details

Defined in Text.Colour.Code

Eq ColourIntensity Source # 
Instance details

Defined in Text.Colour.Code

Show ColourIntensity Source # 
Instance details

Defined in Text.Colour.Code

Generic ColourIntensity Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep ColourIntensity :: Type -> Type #

Validity ColourIntensity Source # 
Instance details

Defined in Text.Colour.Code

type Rep ColourIntensity Source # 
Instance details

Defined in Text.Colour.Code

type Rep ColourIntensity = D1 ('MetaData "ColourIntensity" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'False) (C1 ('MetaCons "Dull" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Bright" 'PrefixI 'False) (U1 :: Type -> Type))

data ConsoleLayer Source #

ANSI colours can be set on two different layers

Constructors

Foreground 
Background 

Instances

Instances details
Bounded ConsoleLayer Source # 
Instance details

Defined in Text.Colour.Code

Enum ConsoleLayer Source # 
Instance details

Defined in Text.Colour.Code

Eq ConsoleLayer Source # 
Instance details

Defined in Text.Colour.Code

Show ConsoleLayer Source # 
Instance details

Defined in Text.Colour.Code

Generic ConsoleLayer Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep ConsoleLayer :: Type -> Type #

Validity ConsoleLayer Source # 
Instance details

Defined in Text.Colour.Code

type Rep ConsoleLayer Source # 
Instance details

Defined in Text.Colour.Code

type Rep ConsoleLayer = D1 ('MetaData "ConsoleLayer" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'False) (C1 ('MetaCons "Foreground" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Background" 'PrefixI 'False) (U1 :: Type -> Type))

data TerminalColour Source #

Constructors

Black 
Red 
Green 
Yellow 
Blue 
Magenta 
Cyan 
White 

Instances

Instances details
Bounded TerminalColour Source # 
Instance details

Defined in Text.Colour.Code

Enum TerminalColour Source # 
Instance details

Defined in Text.Colour.Code

Eq TerminalColour Source # 
Instance details

Defined in Text.Colour.Code

Show TerminalColour Source # 
Instance details

Defined in Text.Colour.Code

Generic TerminalColour Source # 
Instance details

Defined in Text.Colour.Code

Associated Types

type Rep TerminalColour :: Type -> Type #

Validity TerminalColour Source # 
Instance details

Defined in Text.Colour.Code

type Rep TerminalColour Source # 
Instance details

Defined in Text.Colour.Code

type Rep TerminalColour = D1 ('MetaData "TerminalColour" "Text.Colour.Code" "safe-coloured-text-0.2.0.1-5GFg0gc5PUEESE1K2b92mc" 'False) (((C1 ('MetaCons "Black" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Red" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Green" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Yellow" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Blue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Magenta" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Cyan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "White" 'PrefixI 'False) (U1 :: Type -> Type))))