module Language.Haskell.HsColour.TTY (hscolour,hscolourG) where
import Language.Haskell.HsColour.ANSI as ANSI
import Language.Haskell.HsColour.Classify
import Language.Haskell.HsColour.Colourise
import Language.Haskell.HsColour.Output(TerminalType(Ansi16Colour))
hscolour :: ColourPrefs
-> String
-> String
hscolour :: ColourPrefs -> String -> String
hscolour = TerminalType -> ColourPrefs -> String -> String
hscolourG TerminalType
Ansi16Colour
hscolourG :: TerminalType -> ColourPrefs -> String -> String
hscolourG TerminalType
terminalType ColourPrefs
pref = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (TerminalType -> ColourPrefs -> (TokenType, String) -> String
renderTokenG TerminalType
terminalType ColourPrefs
pref) forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [(TokenType, String)]
tokenise
renderToken :: ColourPrefs -> (TokenType,String) -> String
renderToken :: ColourPrefs -> (TokenType, String) -> String
renderToken = TerminalType -> ColourPrefs -> (TokenType, String) -> String
renderTokenG TerminalType
Ansi16Colour
renderTokenG :: TerminalType -> ColourPrefs -> (TokenType, String) -> String
renderTokenG TerminalType
terminalType ColourPrefs
pref (TokenType
t,String
s) = TerminalType -> [Highlight] -> String -> String
ANSI.highlightG TerminalType
terminalType (ColourPrefs -> TokenType -> [Highlight]
colourise ColourPrefs
pref TokenType
t) String
s