idris-1.0: Functional Programming Language with Dependent Types

Copyright | License : BSD3
Maintainer | The Idris Community.
Safe Haskell | None
Language | Haskell98

Idris.Colours

Description

Synopsis

- data IdrisColour = IdrisColour {
  - colour :: Maybe Color
  - vivid :: Bool
  - underline :: Bool
  - bold :: Bool
  - italic :: Bool
  }
- data ColourTheme = ColourTheme {
  - keywordColour :: IdrisColour
  - boundVarColour :: IdrisColour
  - implicitColour :: IdrisColour
  - functionColour :: IdrisColour
  - typeColour :: IdrisColour
  - dataColour :: IdrisColour
  - promptColour :: IdrisColour
  - postulateColour :: IdrisColour
  }
- defaultTheme :: ColourTheme
- colouriseKwd :: ColourTheme -> String -> String
- colouriseBound :: ColourTheme -> String -> String
- colouriseImplicit :: ColourTheme -> String -> String
- colourisePostulate :: ColourTheme -> String -> String
- colouriseType :: ColourTheme -> String -> String
- colouriseFun :: ColourTheme -> String -> String
- colouriseData :: ColourTheme -> String -> String
- colouriseKeyword :: ColourTheme -> String -> String
- colourisePrompt :: ColourTheme -> String -> String
- colourise :: IdrisColour -> String -> String
- data ColourType
  - = KeywordColour
  - | BoundVarColour
  - | ImplicitColour
  - | FunctionColour
  - | TypeColour
  - | DataColour
  - | PromptColour
  - | PostulateColour
- hStartColourise :: Handle -> IdrisColour -> IO ()
- hEndColourise :: Handle -> IdrisColour -> IO ()

# Documentation

data IdrisColour #

Constructors

IdrisColour |
Fields colour :: Maybe Color vivid :: Bool underline :: Bool bold :: Bool italic :: Bool

Instances

Eq IdrisColour # |
Methods (==) :: IdrisColour -> IdrisColour -> Bool # (/=) :: IdrisColour -> IdrisColour -> Bool #
Show IdrisColour # |
Methods showsPrec :: Int -> IdrisColour -> ShowS # show :: IdrisColour -> String # showList :: [IdrisColour] -> ShowS #

data ColourTheme #

Constructors

ColourTheme |
Fields keywordColour :: IdrisColour boundVarColour :: IdrisColour implicitColour :: IdrisColour functionColour :: IdrisColour typeColour :: IdrisColour dataColour :: IdrisColour promptColour :: IdrisColour postulateColour :: IdrisColour

Instances

Eq ColourTheme # |
Methods (==) :: ColourTheme -> ColourTheme -> Bool # (/=) :: ColourTheme -> ColourTheme -> Bool #
Show ColourTheme # |
Methods showsPrec :: Int -> ColourTheme -> ShowS # show :: ColourTheme -> String # showList :: [ColourTheme] -> ShowS #
Generic ColourTheme # |
Associated Types type Rep ColourTheme :: * -> * # Methods from :: ColourTheme -> Rep ColourTheme x # to :: Rep ColourTheme x -> ColourTheme #
type Rep ColourTheme # |
type Rep ColourTheme = D1 (MetaData "ColourTheme" "Idris.Colours" "idris-1.0-AhzFHyMpjVK9jY0cFJjTN5" False) (C1 (MetaCons "ColourTheme" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "keywordColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour)) (S1 (MetaSel (Just Symbol "boundVarColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour))) ((:*:) (S1 (MetaSel (Just Symbol "implicitColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour)) (S1 (MetaSel (Just Symbol "functionColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "typeColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour)) (S1 (MetaSel (Just Symbol "dataColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour))) ((:*:) (S1 (MetaSel (Just Symbol "promptColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour)) (S1 (MetaSel (Just Symbol "postulateColour") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IdrisColour))))))

defaultTheme :: ColourTheme #

Idris's default console colour theme

colouriseKwd :: ColourTheme -> String -> String #

colouriseBound :: ColourTheme -> String -> String #

colouriseImplicit :: ColourTheme -> String -> String #

colourisePostulate :: ColourTheme -> String -> String #

colouriseType :: ColourTheme -> String -> String #

colouriseFun :: ColourTheme -> String -> String #

colouriseData :: ColourTheme -> String -> String #

colouriseKeyword :: ColourTheme -> String -> String #

colourisePrompt :: ColourTheme -> String -> String #

colourise :: IdrisColour -> String -> String #

Set the colour of a string using POSIX escape codes

data ColourType #

Constructors

KeywordColour |
BoundVarColour |
ImplicitColour |
FunctionColour |
TypeColour |
DataColour |
PromptColour |
PostulateColour |

Instances

Bounded ColourType # |
Methods minBound :: ColourType # maxBound :: ColourType #
Enum ColourType # |
Methods succ :: ColourType -> ColourType # pred :: ColourType -> ColourType # toEnum :: Int -> ColourType # fromEnum :: ColourType -> Int # enumFrom :: ColourType -> [ColourType] # enumFromThen :: ColourType -> ColourType -> [ColourType] # enumFromTo :: ColourType -> ColourType -> [ColourType] # enumFromThenTo :: ColourType -> ColourType -> ColourType -> [ColourType] #
Eq ColourType # |
Methods (==) :: ColourType -> ColourType -> Bool # (/=) :: ColourType -> ColourType -> Bool #
Show ColourType # |
Methods showsPrec :: Int -> ColourType -> ShowS # show :: ColourType -> String # showList :: [ColourType] -> ShowS #

hStartColourise :: Handle -> IdrisColour -> IO () #

Start a colour on a handle, to support colour output on Windows

hEndColourise :: Handle -> IdrisColour -> IO () #

End a colour region on a handle