-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Print text to terminal with colors and effects -- -- rainbow helps you print Text chunks to a terminal with colors and -- effects such as bold, underlining, etc. You pair each Text with a -- description of how it should appear. Rainbow works with both 8-color -- and 256-color terminals. @package rainbow @version 0.2.0.0 -- | Handles colors and special effects for text. Internally this module -- uses the Haskell terminfo library, which links against the UNIX -- library of the same name, so it should work with a wide variety of -- UNIX terminals. -- -- The building block of Rainbow is the Chunk. Each Chunk comes -- with a TextSpec, which specifies how the text should look on -- 8-color and on 256-color terminals. The Chunk is a full specification; -- that is, although Chunks are typically printed one after the other, -- the appearance of one Chunk does not affect the appearance of the next -- Chunk. -- -- You have full freedom to specify different attributes and colors for 8 -- and 256 color terminals; for instance, you can have text appear red on -- an 8-color terminal but blue on a 256-color terminal. -- -- Some useful combinators are provided to assist with the building of -- Chunks. plain builds a Chunk with a provided Text that -- is rendered using the terminal's default settings and colors. You then -- use +.+ to combine different modifiers to change how the Chunk -- is rendered. Here's an example: -- --
-- {-# LANGUAGE OverloadedStrings #-}
--
-- -- This chunk is blue and underlined, both on 8-color and 256-color
-- -- terminals.
-- blueHello :: Chunk
-- blueHello = plain "Hello world!" +.+ f_blue +.+ underline
--
-- -- This chunk is red on 8-color terminals but uses color 88 on
-- -- 256-color terminals. Because +.+ is left-associative, the
-- -- color256_f_88 supersedes the f_red, which sets the foreground
-- -- on both 8 and 256 color terminals to red.
-- redHello :: Chunk
-- redHello = plain "Hello world!" +.+ f_red +.+ color256_f_88
--
-- -- This chunk is underlined on 8-color terminals but is not
-- -- underlined on 256-color terminals.
-- underlinedOn8 :: Chunk
-- underlinedOn8 = plain "Hello world!" +.+ underline8
--
-- newline :: Chunk
-- newline = plain "\n"
--
-- -- How to print all these chunks
-- main :: IO ()
-- main = do
-- t <- termFromEnv
-- printChunks t [blueHello, nl, redHello, nl, underlinedOn8, nl]
--
module System.Console.Rainbow
-- | Which terminal definition to use.
data Term
-- | Using this terminal should always succeed. This suppresses all colors.
-- Uesful if output is not going to a TTY, or if you just do not like
-- colors.
Dumb :: Term
-- | Use the terminal with this given name. You might get this from the
-- TERM environment variable, or set it explicitly. A runtime error will
-- result if the terminfo database does not have a definition for this
-- terminal. If this terminal supports 256 colors, then 256 colors are
-- used. If this terminal supports less than 256 colors, but at least 8
-- colors, then 8 colors are used. Otherwise, no colors are used.
TermName :: String -> Term
-- | Gets the terminal definition from the environment. If the environment
-- does not have a TERM veriable, use Dumb.
termFromEnv :: IO Term
-- | Gets the terminal definition from the environment. If the first
-- argument is True, the terminal is always obtained from the
-- environment. If it is False, the terminal is only obtained from the
-- environment if the given handle is not a terminal; otherwise, Dumb is
-- returned.
smartTermFromEnv :: Bool -> Handle -> IO Term
-- | A chunk is some textual data coupled with a description of what color
-- the text is, attributes like whether it is bold or underlined, etc.
-- The chunk knows what foreground and background colors and what
-- attributes to use for both an 8 color terminal and a 256 color
-- terminal. To change these attributes and colors, you must make a new
-- chunk.
--
-- There is no way to combine chunks. To print large numbers of chunks,
-- lazily build a list of them and then print them using
-- printChunks.
data Chunk
-- | Makes a plain Chunk; that is, one that has no effects and is printed
-- in the default foreground and background color for the terminal.
-- Modify this chunk so that it has the colors and effects that you want.
plain :: Text -> Chunk
-- | Sends a list of chunks to standard output for printing. Sets up the
-- terminal (this only needs to be done once.) Lazily processes the list
-- of Chunk.
--
-- Which colors are used depends upon the Term. If it is
-- Dumb, then no colors are used on output. If the Term is
-- specified with TermName, the UNIX terminfo library is used to
-- determine how many colors the terminal supports. If it supports at
-- least 256 colors, then 256 colors are used. If it supports at least 8
-- colors but less than 256 colors, then 256 colors are used. Otherwise,
-- no colors are used. A runtime error will occur if the TermName
-- is not found in the system terminal database.
printChunks :: Term -> [Chunk] -> IO ()
-- | Sends a list of chunks to the given handle for printing. Sets up the
-- terminal (this only needs to be done once.) Lazily processes the list
-- of Chunk. See printChunks for notes on how many colors are
-- used.
hPrintChunks :: Handle -> Term -> [Chunk] -> IO ()
-- | A Mod is anything capable of modifying a Chunk. Usually these will
-- modify the TextSpec, though a few Mod instead modify the Text itself.
-- Typically you will create a Chunk with plain and then use
-- +.+ repeatedly to modify the Chunk to suit your needs.
class Mod a
changeChunk :: Mod a => Chunk -> a -> Chunk
-- | Useful if you want to inspect the text in a Chunk and then build a new
-- Chunk with different text.
--
--
-- {-# LANGUAGE OverloadedStrings #-}
-- import Data.Text (append)
-- helloDolly :: Chunk
-- helloDolly = plain "Hello" +.+ ChangeText (`append` " Dolly")
--
newtype ChangeText
ChangeText :: (Text -> Text) -> ChangeText
unChangeText :: ChangeText -> Text -> Text
-- | Composes modifiers. Useful to build up a single function that modifies
-- a Chunk. You might use this to build up several modifiers and use them
-- repeatedly, or you might write an API that expects functions of type
-- Chunk -> Chunk and then you could use .+. to build
-- those functions. Left associative.
--
-- -- redBoldUnderline :: Chunk -> Chunk -- redBoldUnderline = id .+. f_red .+. bold .+. underline --(.+.) :: Mod a => (Chunk -> Chunk) -> a -> Chunk -> Chunk -- | Applies a modifier to a Chunk. Left associative. (+.+) :: Mod a => Chunk -> a -> Chunk bold :: BoldAll boldOff :: BoldAll underline :: UnderlineAll underlineOff :: UnderlineAll flash :: FlashAll flashOff :: FlashAll inverse :: InverseAll inverseOff :: InverseAll bold8 :: Bold8 bold8off :: Bold8 underline8 :: Underline8 underline8off :: Underline8 flash8 :: Flash8 flash8off :: Flash8 inverse8 :: Inverse8 inverse8off :: Inverse8 bold256 :: Bold256 bold256off :: Bold256 underline256 :: Underline256 underline256off :: Underline256 flash256 :: Flash256 flash256off :: Flash256 inverse256 :: Inverse256 inverse256off :: Inverse256 f_default :: ForegroundAll f_black :: ForegroundAll f_red :: ForegroundAll f_green :: ForegroundAll f_yellow :: ForegroundAll f_blue :: ForegroundAll f_magenta :: ForegroundAll f_cyan :: ForegroundAll f_white :: ForegroundAll b_default :: BackgroundAll b_black :: BackgroundAll b_red :: BackgroundAll b_green :: BackgroundAll b_yellow :: BackgroundAll b_blue :: BackgroundAll b_magenta :: BackgroundAll b_cyan :: BackgroundAll b_white :: BackgroundAll color8_f_default :: Foreground8 color8_f_black :: Foreground8 color8_f_red :: Foreground8 color8_f_green :: Foreground8 color8_f_yellow :: Foreground8 color8_f_blue :: Foreground8 color8_f_magenta :: Foreground8 color8_f_cyan :: Foreground8 color8_f_white :: Foreground8 color8_b_default :: Background8 color8_b_black :: Background8 color8_b_red :: Background8 color8_b_green :: Background8 color8_b_yellow :: Background8 color8_b_blue :: Background8 color8_b_magenta :: Background8 color8_b_cyan :: Background8 color8_b_white :: Background8 color256_f_default :: Foreground256 color256_f_0 :: Foreground256 color256_f_black :: Foreground256 color256_f_1 :: Foreground256 color256_f_red :: Foreground256 color256_f_2 :: Foreground256 color256_f_green :: Foreground256 color256_f_3 :: Foreground256 color256_f_yellow :: Foreground256 color256_f_4 :: Foreground256 color256_f_blue :: Foreground256 color256_f_5 :: Foreground256 color256_f_magenta :: Foreground256 color256_f_6 :: Foreground256 color256_f_cyan :: Foreground256 color256_f_7 :: Foreground256 color256_f_white :: Foreground256 color256_f_8 :: Foreground256 color256_f_grey :: Foreground256 color256_f_9 :: Foreground256 color256_f_red_bright :: Foreground256 color256_f_10 :: Foreground256 color256_f_green_bright :: Foreground256 color256_f_11 :: Foreground256 color256_f_yellow_bright :: Foreground256 color256_f_12 :: Foreground256 color256_f_blue_bright :: Foreground256 color256_f_13 :: Foreground256 color256_f_magenta_bright :: Foreground256 color256_f_14 :: Foreground256 color256_f_cyan_bright :: Foreground256 color256_f_15 :: Foreground256 color256_f_white_bright :: Foreground256 color256_f_16 :: Foreground256 color256_f_17 :: Foreground256 color256_f_18 :: Foreground256 color256_f_19 :: Foreground256 color256_f_20 :: Foreground256 color256_f_21 :: Foreground256 color256_f_22 :: Foreground256 color256_f_23 :: Foreground256 color256_f_24 :: Foreground256 color256_f_25 :: Foreground256 color256_f_26 :: Foreground256 color256_f_27 :: Foreground256 color256_f_28 :: Foreground256 color256_f_29 :: Foreground256 color256_f_30 :: Foreground256 color256_f_31 :: Foreground256 color256_f_32 :: Foreground256 color256_f_33 :: Foreground256 color256_f_34 :: Foreground256 color256_f_35 :: Foreground256 color256_f_36 :: Foreground256 color256_f_37 :: Foreground256 color256_f_38 :: Foreground256 color256_f_39 :: Foreground256 color256_f_40 :: Foreground256 color256_f_41 :: Foreground256 color256_f_42 :: Foreground256 color256_f_43 :: Foreground256 color256_f_44 :: Foreground256 color256_f_45 :: Foreground256 color256_f_46 :: Foreground256 color256_f_47 :: Foreground256 color256_f_48 :: Foreground256 color256_f_49 :: Foreground256 color256_f_50 :: Foreground256 color256_f_51 :: Foreground256 color256_f_52 :: Foreground256 color256_f_53 :: Foreground256 color256_f_54 :: Foreground256 color256_f_55 :: Foreground256 color256_f_56 :: Foreground256 color256_f_57 :: Foreground256 color256_f_58 :: Foreground256 color256_f_59 :: Foreground256 color256_f_60 :: Foreground256 color256_f_61 :: Foreground256 color256_f_62 :: Foreground256 color256_f_63 :: Foreground256 color256_f_64 :: Foreground256 color256_f_65 :: Foreground256 color256_f_66 :: Foreground256 color256_f_67 :: Foreground256 color256_f_68 :: Foreground256 color256_f_69 :: Foreground256 color256_f_70 :: Foreground256 color256_f_71 :: Foreground256 color256_f_72 :: Foreground256 color256_f_73 :: Foreground256 color256_f_74 :: Foreground256 color256_f_75 :: Foreground256 color256_f_76 :: Foreground256 color256_f_77 :: Foreground256 color256_f_78 :: Foreground256 color256_f_79 :: Foreground256 color256_f_80 :: Foreground256 color256_f_81 :: Foreground256 color256_f_82 :: Foreground256 color256_f_83 :: Foreground256 color256_f_84 :: Foreground256 color256_f_85 :: Foreground256 color256_f_86 :: Foreground256 color256_f_87 :: Foreground256 color256_f_88 :: Foreground256 color256_f_89 :: Foreground256 color256_f_90 :: Foreground256 color256_f_91 :: Foreground256 color256_f_92 :: Foreground256 color256_f_93 :: Foreground256 color256_f_94 :: Foreground256 color256_f_95 :: Foreground256 color256_f_96 :: Foreground256 color256_f_97 :: Foreground256 color256_f_98 :: Foreground256 color256_f_99 :: Foreground256 color256_f_100 :: Foreground256 color256_f_101 :: Foreground256 color256_f_102 :: Foreground256 color256_f_103 :: Foreground256 color256_f_104 :: Foreground256 color256_f_105 :: Foreground256 color256_f_106 :: Foreground256 color256_f_107 :: Foreground256 color256_f_108 :: Foreground256 color256_f_109 :: Foreground256 color256_f_110 :: Foreground256 color256_f_111 :: Foreground256 color256_f_112 :: Foreground256 color256_f_113 :: Foreground256 color256_f_114 :: Foreground256 color256_f_115 :: Foreground256 color256_f_116 :: Foreground256 color256_f_117 :: Foreground256 color256_f_118 :: Foreground256 color256_f_119 :: Foreground256 color256_f_120 :: Foreground256 color256_f_121 :: Foreground256 color256_f_122 :: Foreground256 color256_f_123 :: Foreground256 color256_f_124 :: Foreground256 color256_f_125 :: Foreground256 color256_f_126 :: Foreground256 color256_f_127 :: Foreground256 color256_f_128 :: Foreground256 color256_f_129 :: Foreground256 color256_f_130 :: Foreground256 color256_f_131 :: Foreground256 color256_f_132 :: Foreground256 color256_f_133 :: Foreground256 color256_f_134 :: Foreground256 color256_f_135 :: Foreground256 color256_f_136 :: Foreground256 color256_f_137 :: Foreground256 color256_f_138 :: Foreground256 color256_f_139 :: Foreground256 color256_f_140 :: Foreground256 color256_f_141 :: Foreground256 color256_f_142 :: Foreground256 color256_f_143 :: Foreground256 color256_f_144 :: Foreground256 color256_f_145 :: Foreground256 color256_f_146 :: Foreground256 color256_f_147 :: Foreground256 color256_f_148 :: Foreground256 color256_f_149 :: Foreground256 color256_f_150 :: Foreground256 color256_f_151 :: Foreground256 color256_f_152 :: Foreground256 color256_f_153 :: Foreground256 color256_f_154 :: Foreground256 color256_f_155 :: Foreground256 color256_f_156 :: Foreground256 color256_f_157 :: Foreground256 color256_f_158 :: Foreground256 color256_f_159 :: Foreground256 color256_f_160 :: Foreground256 color256_f_161 :: Foreground256 color256_f_162 :: Foreground256 color256_f_163 :: Foreground256 color256_f_164 :: Foreground256 color256_f_165 :: Foreground256 color256_f_166 :: Foreground256 color256_f_167 :: Foreground256 color256_f_168 :: Foreground256 color256_f_169 :: Foreground256 color256_f_170 :: Foreground256 color256_f_171 :: Foreground256 color256_f_172 :: Foreground256 color256_f_173 :: Foreground256 color256_f_174 :: Foreground256 color256_f_175 :: Foreground256 color256_f_176 :: Foreground256 color256_f_177 :: Foreground256 color256_f_178 :: Foreground256 color256_f_179 :: Foreground256 color256_f_180 :: Foreground256 color256_f_181 :: Foreground256 color256_f_182 :: Foreground256 color256_f_183 :: Foreground256 color256_f_184 :: Foreground256 color256_f_185 :: Foreground256 color256_f_186 :: Foreground256 color256_f_187 :: Foreground256 color256_f_188 :: Foreground256 color256_f_189 :: Foreground256 color256_f_190 :: Foreground256 color256_f_191 :: Foreground256 color256_f_192 :: Foreground256 color256_f_193 :: Foreground256 color256_f_194 :: Foreground256 color256_f_195 :: Foreground256 color256_f_196 :: Foreground256 color256_f_197 :: Foreground256 color256_f_198 :: Foreground256 color256_f_199 :: Foreground256 color256_f_200 :: Foreground256 color256_f_201 :: Foreground256 color256_f_202 :: Foreground256 color256_f_203 :: Foreground256 color256_f_204 :: Foreground256 color256_f_205 :: Foreground256 color256_f_206 :: Foreground256 color256_f_207 :: Foreground256 color256_f_208 :: Foreground256 color256_f_209 :: Foreground256 color256_f_210 :: Foreground256 color256_f_211 :: Foreground256 color256_f_212 :: Foreground256 color256_f_213 :: Foreground256 color256_f_214 :: Foreground256 color256_f_215 :: Foreground256 color256_f_216 :: Foreground256 color256_f_217 :: Foreground256 color256_f_218 :: Foreground256 color256_f_219 :: Foreground256 color256_f_220 :: Foreground256 color256_f_221 :: Foreground256 color256_f_222 :: Foreground256 color256_f_223 :: Foreground256 color256_f_224 :: Foreground256 color256_f_225 :: Foreground256 color256_f_226 :: Foreground256 color256_f_227 :: Foreground256 color256_f_228 :: Foreground256 color256_f_229 :: Foreground256 color256_f_230 :: Foreground256 color256_f_231 :: Foreground256 color256_f_232 :: Foreground256 color256_f_233 :: Foreground256 color256_f_234 :: Foreground256 color256_f_235 :: Foreground256 color256_f_236 :: Foreground256 color256_f_237 :: Foreground256 color256_f_238 :: Foreground256 color256_f_239 :: Foreground256 color256_f_240 :: Foreground256 color256_f_241 :: Foreground256 color256_f_242 :: Foreground256 color256_f_243 :: Foreground256 color256_f_244 :: Foreground256 color256_f_245 :: Foreground256 color256_f_246 :: Foreground256 color256_f_247 :: Foreground256 color256_f_248 :: Foreground256 color256_f_249 :: Foreground256 color256_f_250 :: Foreground256 color256_f_251 :: Foreground256 color256_f_252 :: Foreground256 color256_f_253 :: Foreground256 color256_f_254 :: Foreground256 color256_f_255 :: Foreground256 color256_b_default :: Background256 color256_b_0 :: Background256 color256_b_black :: Background256 color256_b_1 :: Background256 color256_b_red :: Background256 color256_b_2 :: Background256 color256_b_green :: Background256 color256_b_3 :: Background256 color256_b_yellow :: Background256 color256_b_4 :: Background256 color256_b_blue :: Background256 color256_b_5 :: Background256 color256_b_magenta :: Background256 color256_b_6 :: Background256 color256_b_cyan :: Background256 color256_b_7 :: Background256 color256_b_white :: Background256 color256_b_8 :: Background256 color256_b_grey :: Background256 color256_b_9 :: Background256 color256_b_red_bright :: Background256 color256_b_10 :: Background256 color256_b_green_bright :: Background256 color256_b_11 :: Background256 color256_b_yellow_bright :: Background256 color256_b_12 :: Background256 color256_b_blue_bright :: Background256 color256_b_13 :: Background256 color256_b_magenta_bright :: Background256 color256_b_14 :: Background256 color256_b_cyan_bright :: Background256 color256_b_15 :: Background256 color256_b_white_bright :: Background256 color256_b_16 :: Background256 color256_b_17 :: Background256 color256_b_18 :: Background256 color256_b_19 :: Background256 color256_b_20 :: Background256 color256_b_21 :: Background256 color256_b_22 :: Background256 color256_b_23 :: Background256 color256_b_24 :: Background256 color256_b_25 :: Background256 color256_b_26 :: Background256 color256_b_27 :: Background256 color256_b_28 :: Background256 color256_b_29 :: Background256 color256_b_30 :: Background256 color256_b_31 :: Background256 color256_b_32 :: Background256 color256_b_33 :: Background256 color256_b_34 :: Background256 color256_b_35 :: Background256 color256_b_36 :: Background256 color256_b_37 :: Background256 color256_b_38 :: Background256 color256_b_39 :: Background256 color256_b_40 :: Background256 color256_b_41 :: Background256 color256_b_42 :: Background256 color256_b_43 :: Background256 color256_b_44 :: Background256 color256_b_45 :: Background256 color256_b_46 :: Background256 color256_b_47 :: Background256 color256_b_48 :: Background256 color256_b_49 :: Background256 color256_b_50 :: Background256 color256_b_51 :: Background256 color256_b_52 :: Background256 color256_b_53 :: Background256 color256_b_54 :: Background256 color256_b_55 :: Background256 color256_b_56 :: Background256 color256_b_57 :: Background256 color256_b_58 :: Background256 color256_b_59 :: Background256 color256_b_60 :: Background256 color256_b_61 :: Background256 color256_b_62 :: Background256 color256_b_63 :: Background256 color256_b_64 :: Background256 color256_b_65 :: Background256 color256_b_66 :: Background256 color256_b_67 :: Background256 color256_b_68 :: Background256 color256_b_69 :: Background256 color256_b_70 :: Background256 color256_b_71 :: Background256 color256_b_72 :: Background256 color256_b_73 :: Background256 color256_b_74 :: Background256 color256_b_75 :: Background256 color256_b_76 :: Background256 color256_b_77 :: Background256 color256_b_78 :: Background256 color256_b_79 :: Background256 color256_b_80 :: Background256 color256_b_81 :: Background256 color256_b_82 :: Background256 color256_b_83 :: Background256 color256_b_84 :: Background256 color256_b_85 :: Background256 color256_b_86 :: Background256 color256_b_87 :: Background256 color256_b_88 :: Background256 color256_b_89 :: Background256 color256_b_90 :: Background256 color256_b_91 :: Background256 color256_b_92 :: Background256 color256_b_93 :: Background256 color256_b_94 :: Background256 color256_b_95 :: Background256 color256_b_96 :: Background256 color256_b_97 :: Background256 color256_b_98 :: Background256 color256_b_99 :: Background256 color256_b_100 :: Background256 color256_b_101 :: Background256 color256_b_102 :: Background256 color256_b_103 :: Background256 color256_b_104 :: Background256 color256_b_105 :: Background256 color256_b_106 :: Background256 color256_b_107 :: Background256 color256_b_108 :: Background256 color256_b_109 :: Background256 color256_b_110 :: Background256 color256_b_111 :: Background256 color256_b_112 :: Background256 color256_b_113 :: Background256 color256_b_114 :: Background256 color256_b_115 :: Background256 color256_b_116 :: Background256 color256_b_117 :: Background256 color256_b_118 :: Background256 color256_b_119 :: Background256 color256_b_120 :: Background256 color256_b_121 :: Background256 color256_b_122 :: Background256 color256_b_123 :: Background256 color256_b_124 :: Background256 color256_b_125 :: Background256 color256_b_126 :: Background256 color256_b_127 :: Background256 color256_b_128 :: Background256 color256_b_129 :: Background256 color256_b_130 :: Background256 color256_b_131 :: Background256 color256_b_132 :: Background256 color256_b_133 :: Background256 color256_b_134 :: Background256 color256_b_135 :: Background256 color256_b_136 :: Background256 color256_b_137 :: Background256 color256_b_138 :: Background256 color256_b_139 :: Background256 color256_b_140 :: Background256 color256_b_141 :: Background256 color256_b_142 :: Background256 color256_b_143 :: Background256 color256_b_144 :: Background256 color256_b_145 :: Background256 color256_b_146 :: Background256 color256_b_147 :: Background256 color256_b_148 :: Background256 color256_b_149 :: Background256 color256_b_150 :: Background256 color256_b_151 :: Background256 color256_b_152 :: Background256 color256_b_153 :: Background256 color256_b_154 :: Background256 color256_b_155 :: Background256 color256_b_156 :: Background256 color256_b_157 :: Background256 color256_b_158 :: Background256 color256_b_159 :: Background256 color256_b_160 :: Background256 color256_b_161 :: Background256 color256_b_162 :: Background256 color256_b_163 :: Background256 color256_b_164 :: Background256 color256_b_165 :: Background256 color256_b_166 :: Background256 color256_b_167 :: Background256 color256_b_168 :: Background256 color256_b_169 :: Background256 color256_b_170 :: Background256 color256_b_171 :: Background256 color256_b_172 :: Background256 color256_b_173 :: Background256 color256_b_174 :: Background256 color256_b_175 :: Background256 color256_b_176 :: Background256 color256_b_177 :: Background256 color256_b_178 :: Background256 color256_b_179 :: Background256 color256_b_180 :: Background256 color256_b_181 :: Background256 color256_b_182 :: Background256 color256_b_183 :: Background256 color256_b_184 :: Background256 color256_b_185 :: Background256 color256_b_186 :: Background256 color256_b_187 :: Background256 color256_b_188 :: Background256 color256_b_189 :: Background256 color256_b_190 :: Background256 color256_b_191 :: Background256 color256_b_192 :: Background256 color256_b_193 :: Background256 color256_b_194 :: Background256 color256_b_195 :: Background256 color256_b_196 :: Background256 color256_b_197 :: Background256 color256_b_198 :: Background256 color256_b_199 :: Background256 color256_b_200 :: Background256 color256_b_201 :: Background256 color256_b_202 :: Background256 color256_b_203 :: Background256 color256_b_204 :: Background256 color256_b_205 :: Background256 color256_b_206 :: Background256 color256_b_207 :: Background256 color256_b_208 :: Background256 color256_b_209 :: Background256 color256_b_210 :: Background256 color256_b_211 :: Background256 color256_b_212 :: Background256 color256_b_213 :: Background256 color256_b_214 :: Background256 color256_b_215 :: Background256 color256_b_216 :: Background256 color256_b_217 :: Background256 color256_b_218 :: Background256 color256_b_219 :: Background256 color256_b_220 :: Background256 color256_b_221 :: Background256 color256_b_222 :: Background256 color256_b_223 :: Background256 color256_b_224 :: Background256 color256_b_225 :: Background256 color256_b_226 :: Background256 color256_b_227 :: Background256 color256_b_228 :: Background256 color256_b_229 :: Background256 color256_b_230 :: Background256 color256_b_231 :: Background256 color256_b_232 :: Background256 color256_b_233 :: Background256 color256_b_234 :: Background256 color256_b_235 :: Background256 color256_b_236 :: Background256 color256_b_237 :: Background256 color256_b_238 :: Background256 color256_b_239 :: Background256 color256_b_240 :: Background256 color256_b_241 :: Background256 color256_b_242 :: Background256 color256_b_243 :: Background256 color256_b_244 :: Background256 color256_b_245 :: Background256 color256_b_246 :: Background256 color256_b_247 :: Background256 color256_b_248 :: Background256 color256_b_249 :: Background256 color256_b_250 :: Background256 color256_b_251 :: Background256 color256_b_252 :: Background256 color256_b_253 :: Background256 color256_b_254 :: Background256 color256_b_255 :: Background256 -- | Style elements that apply in both 8 and 256 color terminals. However, -- the elements are described separately for 8 and 256 color terminals, -- so that the text appearance can change depending on how many colors a -- terminal has. data StyleCommon StyleCommon :: Bold -> Underline -> Flash -> Inverse -> StyleCommon scBold :: StyleCommon -> Bold scUnderline :: StyleCommon -> Underline scFlash :: StyleCommon -> Flash scInverse :: StyleCommon -> Inverse -- | Describes text appearance (foreground and background colors, as well -- as other attributes such as bold) for an 8 color terminal. data Style8 Style8 :: Foreground8 -> Background8 -> StyleCommon -> Style8 foreground8 :: Style8 -> Foreground8 background8 :: Style8 -> Background8 common8 :: Style8 -> StyleCommon -- | Describes text appearance (foreground and background colors, as well -- as other attributes such as bold) for a 256 color terminal. data Style256 Style256 :: Foreground256 -> Background256 -> StyleCommon -> Style256 foreground256 :: Style256 -> Foreground256 background256 :: Style256 -> Background256 common256 :: Style256 -> StyleCommon -- | Has all bold, flash, underline, and inverse turned off. defaultStyleCommon :: StyleCommon -- | Uses the default terminal colors (which will vary depending on the -- terminal). defaultStyle8 :: Style8 -- | Uses the default terminal colors (which will vary depending on the -- terminal). defaultStyle256 :: Style256 -- | The TextSpec bundles together the styles for the 8 and 256 color -- terminals, so that the text can be portrayed on any terminal. data TextSpec TextSpec :: Style8 -> Style256 -> TextSpec style8 :: TextSpec -> Style8 style256 :: TextSpec -> Style256 -- | A TextSpec with the default colors on 8 and 256 color terminals, with -- all attributes turned off. defaultTextSpec :: TextSpec chunkTextSpec :: Chunk -> TextSpec chunkText :: Chunk -> Text newtype Bold8 Bold8 :: Bold -> Bold8 unBold8 :: Bold8 -> Bold newtype Underline8 Underline8 :: Underline -> Underline8 unUnderline8 :: Underline8 -> Underline newtype Flash8 Flash8 :: Flash -> Flash8 unFlash8 :: Flash8 -> Flash newtype Inverse8 Inverse8 :: Inverse -> Inverse8 unInverse8 :: Inverse8 -> Inverse newtype Bold256 Bold256 :: Bold -> Bold256 unBold256 :: Bold256 -> Bold newtype Underline256 Underline256 :: Underline -> Underline256 unUnderline256 :: Underline256 -> Underline newtype Flash256 Flash256 :: Flash -> Flash256 unFlash256 :: Flash256 -> Flash newtype Inverse256 Inverse256 :: Inverse -> Inverse256 unInverse256 :: Inverse256 -> Inverse newtype BoldAll BoldAll :: Bool -> BoldAll unBoldAll :: BoldAll -> Bool newtype UnderlineAll UnderlineAll :: Bool -> UnderlineAll unUnderlineAll :: UnderlineAll -> Bool newtype FlashAll FlashAll :: Bool -> FlashAll unFlashAll :: FlashAll -> Bool newtype InverseAll InverseAll :: Bool -> InverseAll unInverseAll :: InverseAll -> Bool data ForegroundAll ForegroundAll :: Foreground8 -> Foreground256 -> ForegroundAll fa8 :: ForegroundAll -> Foreground8 fa256 :: ForegroundAll -> Foreground256 data BackgroundAll BackgroundAll :: Background8 -> Background256 -> BackgroundAll ba8 :: BackgroundAll -> Background8 ba256 :: BackgroundAll -> Background256 newtype Bold Bold :: Bool -> Bold unBold :: Bold -> Bool newtype Underline Underline :: Bool -> Underline unUnderline :: Underline -> Bool newtype Flash Flash :: Bool -> Flash unFlash :: Flash -> Bool newtype Inverse Inverse :: Bool -> Inverse unInverse :: Inverse -> Bool -- | Background color in an 8 color setting. newtype Background8 Background8 :: Maybe Color -> Background8 unBackground8 :: Background8 -> Maybe Color -- | Background color in a 256 color setting. newtype Background256 Background256 :: Maybe Color -> Background256 unBackground256 :: Background256 -> Maybe Color -- | Foreground color in an 8 color setting. newtype Foreground8 Foreground8 :: Maybe Color -> Foreground8 unForeground8 :: Foreground8 -> Maybe Color -- | Foreground color in a 256 color setting. newtype Foreground256 Foreground256 :: Maybe Color -> Foreground256 unForeground256 :: Foreground256 -> Maybe Color instance Eq Term instance Show Term instance Eq Background8 instance Show Background8 instance Ord Background8 instance Eq Background256 instance Show Background256 instance Ord Background256 instance Eq Foreground8 instance Show Foreground8 instance Ord Foreground8 instance Eq Foreground256 instance Show Foreground256 instance Ord Foreground256 instance Show Bold instance Eq Bold instance Ord Bold instance Show Underline instance Eq Underline instance Ord Underline instance Show Flash instance Eq Flash instance Ord Flash instance Show Inverse instance Eq Inverse instance Ord Inverse instance Show Bold8 instance Eq Bold8 instance Ord Bold8 instance Show Underline8 instance Eq Underline8 instance Ord Underline8 instance Show Flash8 instance Eq Flash8 instance Ord Flash8 instance Show Inverse8 instance Eq Inverse8 instance Ord Inverse8 instance Show Bold256 instance Eq Bold256 instance Ord Bold256 instance Show Underline256 instance Eq Underline256 instance Ord Underline256 instance Show Flash256 instance Eq Flash256 instance Ord Flash256 instance Show Inverse256 instance Eq Inverse256 instance Ord Inverse256 instance Eq BoldAll instance Ord BoldAll instance Show BoldAll instance Eq UnderlineAll instance Ord UnderlineAll instance Show UnderlineAll instance Eq FlashAll instance Ord FlashAll instance Show FlashAll instance Eq InverseAll instance Ord InverseAll instance Show InverseAll instance Show StyleCommon instance Eq StyleCommon instance Ord StyleCommon instance Show Style8 instance Eq Style8 instance Ord Style8 instance Show Style256 instance Eq Style256 instance Ord Style256 instance Show TextSpec instance Eq TextSpec instance Ord TextSpec instance Eq Chunk instance Show Chunk instance Ord Chunk instance Mod BackgroundAll instance Mod ForegroundAll instance Mod InverseAll instance Mod FlashAll instance Mod UnderlineAll instance Mod BoldAll instance Mod Inverse256 instance Mod Flash256 instance Mod Underline256 instance Mod Bold256 instance Mod Inverse8 instance Mod Flash8 instance Mod Underline8 instance Mod Bold8 instance Mod Foreground256 instance Mod Foreground8 instance Mod Background256 instance Mod Background8 instance Mod ChangeText instance Mod Text