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

-- | Colourise Haskell code.
--   
--   hscolour is a small Haskell script to colourise Haskell code. It
--   currently has six output formats: ANSI terminal codes (optionally
--   XTerm-256colour codes), HTML 3.2 with font tags, HTML 4.01 with
--   CSS, HTML 4.01 with CSS and mouseover annotations, XHTML 1.0 with
--   inline CSS styling, LaTeX, and mIRC chat codes.
@package hscolour
@version 1.25

module Language.Haskell.HsColour.Classify

-- | Classification of tokens as lexical entities
data TokenType
Space :: TokenType
Keyword :: TokenType
Keyglyph :: TokenType
Layout :: TokenType
Comment :: TokenType
Conid :: TokenType
Varid :: TokenType
Conop :: TokenType
Varop :: TokenType
String :: TokenType
Char :: TokenType
Number :: TokenType
Cpp :: TokenType
Error :: TokenType
Definition :: TokenType

-- | Lex Haskell source code into an annotated token stream, without
--   discarding any characters or layout.
tokenise :: String -> [(TokenType, String)]
instance GHC.Classes.Eq Language.Haskell.HsColour.Classify.TokenType
instance GHC.Internal.Show.Show Language.Haskell.HsColour.Classify.TokenType

module Language.Haskell.HsColour.ColourHighlight

-- | Colours supported by ANSI codes.
data Colour
Black :: Colour
Red :: Colour
Green :: Colour
Yellow :: Colour
Blue :: Colour
Magenta :: Colour
Cyan :: Colour
White :: Colour
Rgb :: Word8 -> Word8 -> Word8 -> Colour

-- | Types of highlighting supported by ANSI codes (and some extra styles).
data Highlight
Normal :: Highlight
Bold :: Highlight
Dim :: Highlight
Underscore :: Highlight
Blink :: Highlight
ReverseVideo :: Highlight
Concealed :: Highlight
Foreground :: Colour -> Highlight
Background :: Colour -> Highlight
Italic :: Highlight

-- | Convert an integer in the range [0,2^24-1] to its base 256-triplet,
--   passing the result to the given continuation (avoid unnecessary
--   tupleism).
base256 :: Integral int => (Word8 -> Word8 -> Word8 -> r) -> int -> r

-- | Convert a three-digit numeral in the given (as arg 1) base to its
--   integer value.
unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> int

-- | Approximate a 24-bit Rgb colour with a colour in the xterm256 6x6x6
--   colour cube, returning its index.
rgb24bit_to_xterm256 :: Integral t => Word8 -> Word8 -> Word8 -> t

-- | Ap"proxi"mate a 24-bit Rgb colour with an ANSI8 colour. Will leave
--   other colours unchanged and will never return an Rgb
--   constructor value.
projectToBasicColour8 :: Colour -> Colour

-- | Lift projectToBasicColour8 to Highlights
hlProjectToBasicColour8 :: Highlight -> Highlight
instance GHC.Internal.Enum.Enum Language.Haskell.HsColour.ColourHighlight.Colour
instance GHC.Classes.Eq Language.Haskell.HsColour.ColourHighlight.Colour
instance GHC.Classes.Eq Language.Haskell.HsColour.ColourHighlight.Highlight
instance GHC.Internal.Read.Read Language.Haskell.HsColour.ColourHighlight.Colour
instance GHC.Internal.Read.Read Language.Haskell.HsColour.ColourHighlight.Highlight
instance GHC.Internal.Show.Show Language.Haskell.HsColour.ColourHighlight.Colour
instance GHC.Internal.Show.Show Language.Haskell.HsColour.ColourHighlight.Highlight

module Language.Haskell.HsColour.Colourise

-- | Colour preferences.
data ColourPrefs
ColourPrefs :: [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> ColourPrefs
[keyword] :: ColourPrefs -> [Highlight]
[keyglyph] :: ColourPrefs -> [Highlight]
[layout] :: ColourPrefs -> [Highlight]
[comment] :: ColourPrefs -> [Highlight]
[conid] :: ColourPrefs -> [Highlight]
[varid] :: ColourPrefs -> [Highlight]
[conop] :: ColourPrefs -> [Highlight]
[varop] :: ColourPrefs -> [Highlight]
[string] :: ColourPrefs -> [Highlight]
[char] :: ColourPrefs -> [Highlight]
[number] :: ColourPrefs -> [Highlight]
[cpp] :: ColourPrefs -> [Highlight]
[selection] :: ColourPrefs -> [Highlight]
[variantselection] :: ColourPrefs -> [Highlight]
[definition] :: ColourPrefs -> [Highlight]

-- | Read colour preferences from .hscolour file in the current directory,
--   or failing that, from $HOME/.hscolour, and failing that, returns a
--   default set of prefs.
readColourPrefs :: IO ColourPrefs
defaultColourPrefs :: ColourPrefs

-- | Convert token classification to colour highlights.
colourise :: ColourPrefs -> TokenType -> [Highlight]
instance GHC.Classes.Eq Language.Haskell.HsColour.Colourise.ColourPrefs
instance GHC.Internal.Read.Read Language.Haskell.HsColour.Colourise.ColourPrefs
instance GHC.Internal.Show.Show Language.Haskell.HsColour.Colourise.ColourPrefs

module Language.Haskell.HsColour.General
dropLast :: Eq a => a -> [a] -> [a]
dropFirst :: Eq a => a -> [a] -> [a]

module Language.Haskell.HsColour.Anchors

-- | insertAnchors places an anchor marker in the token stream
--   before the first defining occurrence of any identifier. Here,
--   before means immediately preceding its type signature, or
--   preceding a (haddock) comment that comes immediately before the type
--   signature, or failing either of those, before the first equation.
insertAnchors :: [(TokenType, String)] -> [Either Anchor (TokenType, String)]

-- | Formats Haskell source code using HTML with font tags.
module Language.Haskell.HsColour.HTML

-- | Formats Haskell source code using HTML with font tags.
hscolour :: ColourPrefs -> Bool -> Int -> String -> String
top'n'tail :: String -> String -> String
renderAnchors :: (a -> String) -> Either String a -> String
renderComment :: String -> String
renderNewLinesAnchors :: Int -> String -> String
escape :: String -> String

-- | Formats Haskell source code as HTML with CSS.
module Language.Haskell.HsColour.CSS

-- | Formats Haskell source code as a complete HTML document with CSS.
hscolour :: Bool -> Int -> String -> String
top'n'tail :: String -> String -> String
renderToken :: (TokenType, String) -> String
pre :: String -> String

-- | Formats Haskell source code as HTML with CSS and Mouseover Type
--   Annotations
module Language.Haskell.HsColour.ACSS

-- | Formats Haskell source code using HTML and mouse-over annotations
hscolour :: Bool -> Int -> String -> String

-- | Formats Haskell source code using HTML and mouse-over annotations
hsannot :: Bool -> Int -> (String, AnnMap) -> String
newtype AnnMap
Ann :: Map Loc (String, String) -> AnnMap
newtype Loc
L :: (Int, Int) -> Loc
breakS :: String
srcModuleName :: String -> String
instance GHC.Classes.Eq Language.Haskell.HsColour.ACSS.Loc
instance GHC.Classes.Ord Language.Haskell.HsColour.ACSS.Loc
instance GHC.Internal.Show.Show Language.Haskell.HsColour.ACSS.AnnMap
instance GHC.Internal.Show.Show Language.Haskell.HsColour.ACSS.Loc

-- | Formats Haskell source code as HTML with inline CSS.
module Language.Haskell.HsColour.InlineCSS

-- | Formats Haskell source code as a complete HTML document with inline
--   styling
hscolour :: ColourPrefs -> Bool -> Int -> String -> String
top'n'tail :: String -> String -> String

-- | Formats Haskell source code using LaTeX macros.
module Language.Haskell.HsColour.LaTeX

-- | Formats Haskell source code as a complete LaTeX document.
hscolour :: ColourPrefs -> String -> String
top'n'tail :: String -> String -> String

-- | Formats Haskell source code using mIRC codes. (see
--   http://irssi.org/documentation/formats)
module Language.Haskell.HsColour.MIRC

-- | Formats Haskell source code using mIRC codes.
hscolour :: ColourPrefs -> String -> String

module Language.Haskell.HsColour.Output
data TerminalType

-- | \033[Xm-style escape sequences (with X =~ [34][0-7])
Ansi16Colour :: TerminalType

-- | 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).
XTerm256Compatible :: TerminalType

-- | The supported output formats.
data Output

-- | ANSI terminal codes. Equivalent to TTYg Ansi16Colour but
--   left in for backwards compatibility.
TTY :: Output

-- | Terminal codes appropriate for the TerminalType.
TTYg :: TerminalType -> Output

-- | TeX macros
LaTeX :: Output

-- | HTML with font tags
HTML :: Output

-- | HTML with CSS.
CSS :: Output

-- | HTML with CSS and mouseover types.
ACSS :: Output

-- | HTML with inline CSS.
ICSS :: Output

-- | mIRC chat clients
MIRC :: Output
instance GHC.Classes.Eq Language.Haskell.HsColour.Output.Output
instance GHC.Classes.Eq Language.Haskell.HsColour.Output.TerminalType
instance GHC.Classes.Ord Language.Haskell.HsColour.Output.TerminalType
instance GHC.Internal.Show.Show Language.Haskell.HsColour.Output.Output
instance GHC.Internal.Show.Show Language.Haskell.HsColour.Output.TerminalType

module Language.Haskell.HsColour.Options

-- | Command-line options
data Option

-- | print usage message
Help :: Option

-- | report version
Version :: Option

-- | report auxiliary information, e.g. CSS defaults
Information :: Option

-- | what type of output to produce
Format :: Output -> Option

-- | literate input (i.e. multiple embedded fragments)
LHS :: Bool -> Option

-- | whether to add anchors
Anchors :: Bool -> Option

-- | whether to produce a full document or partial
Partial :: Bool -> Option

-- | input source file
Input :: FilePath -> Option

-- | output source file
Output :: FilePath -> Option

-- | annotations file
Annot :: FilePath -> Option

-- | The supported output formats.
data Output

-- | ANSI terminal codes. Equivalent to TTYg Ansi16Colour but
--   left in for backwards compatibility.
TTY :: Output

-- | Terminal codes appropriate for the TerminalType.
TTYg :: TerminalType -> Output

-- | TeX macros
LaTeX :: Output

-- | HTML with font tags
HTML :: Output

-- | HTML with CSS.
CSS :: Output

-- | HTML with CSS and mouseover types.
ACSS :: Output

-- | HTML with inline CSS.
ICSS :: Output

-- | mIRC chat clients
MIRC :: Output
data TerminalType

-- | \033[Xm-style escape sequences (with X =~ [34][0-7])
Ansi16Colour :: TerminalType

-- | 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).
XTerm256Compatible :: TerminalType
instance GHC.Classes.Eq Language.Haskell.HsColour.Options.Option

-- | Partially taken from Hugs AnsiScreen.hs library:
module Language.Haskell.HsColour.ANSI
highlightOnG :: TerminalType -> [Highlight] -> String

-- | 
highlightOn Ansi16Colour
highlightOn :: [Highlight] -> String
highlightOff :: [Char]

-- | Make the given string appear with all of the listed highlights
highlightG :: TerminalType -> [Highlight] -> String -> String

-- | 
highlightG Ansi16Colour
highlight :: [Highlight] -> String -> String
cleareol :: String
clearbol :: String
clearline :: String
clearDown :: String
clearUp :: String

-- | Clear the screen.
cls :: String

-- | Move the screen cursor to the given position.
goto :: Int -> Int -> String
cursorUp :: String
cursorDown :: String
cursorLeft :: String
cursorRight :: String
savePosition :: String
restorePosition :: String

-- | Types of highlighting supported by ANSI codes (and some extra styles).
data Highlight
Normal :: Highlight
Bold :: Highlight
Dim :: Highlight
Underscore :: Highlight
Blink :: Highlight
ReverseVideo :: Highlight
Concealed :: Highlight
Foreground :: Colour -> Highlight
Background :: Colour -> Highlight
Italic :: Highlight

-- | Colours supported by ANSI codes.
data Colour
Black :: Colour
Red :: Colour
Green :: Colour
Yellow :: Colour
Blue :: Colour
Magenta :: Colour
Cyan :: Colour
White :: Colour
Rgb :: Word8 -> Word8 -> Word8 -> Colour

-- | An infinite supply of colours.
colourCycle :: [Colour]

-- | Scrolling
enableScrollRegion :: Int -> Int -> String
scrollUp :: String
scrollDown :: String
lineWrap :: Bool -> [Char]
data TerminalType

-- | \033[Xm-style escape sequences (with X =~ [34][0-7])
Ansi16Colour :: TerminalType

-- | 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).
XTerm256Compatible :: TerminalType
instance GHC.Internal.Enum.Enum Language.Haskell.HsColour.ColourHighlight.Highlight

-- | Highlights Haskell code with ANSI terminal codes.
module Language.Haskell.HsColour.TTY

-- | 
hscolourG Ansi16Colour
hscolour :: ColourPrefs -> String -> String

-- | Highlights Haskell code with ANSI terminal codes.
hscolourG :: TerminalType -> ColourPrefs -> String -> [Char]

-- | This is a library which colourises Haskell code. It currently has six
--   output formats:
--   
--   
--   
- ANSI terminal codes
--   
- LaTeX macros
--   
- HTML 3.2 with font tags
--   
- HTML 4.01 with external CSS.
--   
- XHTML 1.0 with internal CSS.
--   
- mIRC chat client colour codes.
--   
module Language.Haskell.HsColour

-- | The supported output formats.
data Output

-- | ANSI terminal codes. Equivalent to TTYg Ansi16Colour but
--   left in for backwards compatibility.
TTY :: Output

-- | Terminal codes appropriate for the TerminalType.
TTYg :: TerminalType -> Output

-- | TeX macros
LaTeX :: Output

-- | HTML with font tags
HTML :: Output

-- | HTML with CSS.
CSS :: Output

-- | HTML with CSS and mouseover types.
ACSS :: Output

-- | HTML with inline CSS.
ICSS :: Output

-- | mIRC chat clients
MIRC :: Output

-- | Colour preferences.
data ColourPrefs
ColourPrefs :: [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> [Highlight] -> ColourPrefs
[keyword] :: ColourPrefs -> [Highlight]
[keyglyph] :: ColourPrefs -> [Highlight]
[layout] :: ColourPrefs -> [Highlight]
[comment] :: ColourPrefs -> [Highlight]
[conid] :: ColourPrefs -> [Highlight]
[varid] :: ColourPrefs -> [Highlight]
[conop] :: ColourPrefs -> [Highlight]
[varop] :: ColourPrefs -> [Highlight]
[string] :: ColourPrefs -> [Highlight]
[char] :: ColourPrefs -> [Highlight]
[number] :: ColourPrefs -> [Highlight]
[cpp] :: ColourPrefs -> [Highlight]
[selection] :: ColourPrefs -> [Highlight]
[variantselection] :: ColourPrefs -> [Highlight]
[definition] :: ColourPrefs -> [Highlight]

-- | Colourise Haskell source code with the given output format.
hscolour :: Output -> ColourPrefs -> Bool -> Bool -> String -> Bool -> String -> String
instance GHC.Internal.Show.Show Language.Haskell.HsColour.Lit
