@@ -4,8 +4,7 @@ module Idris.Colours (
4 defaultTheme,
4 defaultTheme,
5 colouriseKwd, colouriseBound, colouriseImplicit,
5 colouriseKwd, colouriseBound, colouriseImplicit,
6 colouriseType, colouriseFun, colouriseData, colouriseKeyword,
6 colouriseType, colouriseFun, colouriseData, colouriseKeyword,
7− colourisePrompt,
7+ colourisePrompt, colourise, ColourType(..)) where
10import System.Console.ANSI
9import System.Console.ANSI
@@ -30,6 +29,7 @@ data ColourTheme = ColourTheme { keywordColour :: IdrisColour
31 deriving (Eq, Show)
30 deriving (Eq, Show)
32+-- | Idris's default console colour theme
33defaultTheme :: ColourTheme
33defaultTheme :: ColourTheme
34defaultTheme = ColourTheme { keywordColour = IdrisColour Nothing True False True False
34defaultTheme = ColourTheme { keywordColour = IdrisColour Nothing True False True False
35 , boundVarColour = mkColour Magenta
35 , boundVarColour = mkColour Magenta
@@ -40,7 +40,7 @@ defaultTheme = ColourTheme { keywordColour = IdrisColour Nothing True False True
40 , promptColour = IdrisColour Nothing True False True False
40 , promptColour = IdrisColour Nothing True False True False
43−-- Set the colour of a string using POSIX escape codes
43+-- | Set the colour of a string using POSIX escape codes
44colourise :: IdrisColour -> String -> String
44colourise :: IdrisColour -> String -> String
45colourise (IdrisColour c v u b i) str = setSGRCode sgr ++ str ++ setSGRCode [Reset]
45colourise (IdrisColour c v u b i) str = setSGRCode sgr ++ str ++ setSGRCode [Reset]
46 where sgr = fg c ++
46 where sgr = fg c ++