ansi-terminal-types-1.1.3/src/0000755000000000000000000000000014405320467014403 5ustar0000000000000000ansi-terminal-types-1.1.3/src/System/0000755000000000000000000000000014405320467015667 5ustar0000000000000000ansi-terminal-types-1.1.3/src/System/Console/0000755000000000000000000000000014405320467017271 5ustar0000000000000000ansi-terminal-types-1.1.3/src/System/Console/ANSI/0000755000000000000000000000000015036525432020023 5ustar0000000000000000ansi-terminal-types-1.1.3/src/System/Console/ANSI/Codes.hs0000644000000000000000000003520415036525432021420 0ustar0000000000000000{-# LANGUAGE Safe #-} {-# LANGUAGE TupleSections #-} {-| This module exports functions that return 'String' values containing codes in accordance with the \'ANSI\' standards for control character sequences described in the documentation of module "System.Console.ANSI". -} module System.Console.ANSI.Codes ( -- * Basic data types module System.Console.ANSI.Types -- * Cursor movement by character -- -- | These functions yield @\"\"@ when the number is @0@ as, on some -- terminals, a @0@ parameter for the underlying \'ANSI\' code specifies a -- default parameter of @1@. , cursorUpCode, cursorDownCode, cursorForwardCode, cursorBackwardCode -- * Cursor movement by line -- -- | These functions yield the equivalent of @setCursorColumnCode 0@ when -- the number is @0@ as, on some terminals, a @0@ parameter for the -- underlying \'ANSI\' code specifies a default parameter of @1@. , cursorUpLineCode, cursorDownLineCode -- * Directly changing cursor position , setCursorColumnCode, setCursorPositionCode -- * Saving, restoring and reporting cursor position , saveCursorCode, restoreCursorCode, reportCursorPositionCode -- * Clearing parts of the screen , clearFromCursorToScreenEndCode, clearFromCursorToScreenBeginningCode , clearScreenCode, clearFromCursorToLineEndCode , clearFromCursorToLineBeginningCode, clearLineCode -- * Enabling and disabling automatic line wrapping -- -- | These functions control whether or not characters automatically wrap to -- the next line when the cursor reaches the right border. , enableLineWrapCode, disableLineWrapCode -- * Scrolling the screen -- -- | These functions yield @\"\"@ when the number is @0@ as, on some -- terminals, a @0@ parameter for the underlying \'ANSI\' code specifies a -- default parameter of @1@. , scrollPageUpCode, scrollPageDownCode -- * Using screen buffers , useAlternateScreenBufferCode, useNormalScreenBufferCode -- * Reporting background or foreground colors , reportLayerColorCode -- * Select Graphic Rendition mode: colors and other whizzy stuff , setSGRCode -- * Cursor visibilty changes , hideCursorCode, showCursorCode -- * Hyperlinks -- -- | Some, but not all, terminals support hyperlinks - that is, clickable -- text that points to a URI. , hyperlinkCode, hyperlinkWithIdCode, hyperlinkWithParamsCode -- * Changing the title , setTitleCode -- * Utilities , colorToCode , Parameter , SubParam , ParamWithSubs , csi , csi' , osc , sgrToCode , sgrToCode' ) where import Data.Char (isPrint) import Data.List (intercalate) import Data.Colour.SRGB (toSRGB24, RGB (..)) import System.Console.ANSI.Types -- | Type synonym representing parameter values (without parameter substrings). -- To represent a paramater value followed by a parameter substring, see -- 'ParamWithSubs'. -- -- @since 1.1 type Parameter = Int -- | Type synonym representing parameter elements of a parameter -- substring. An empty parameter element (which represents a default value for -- the parameter element) has value 'Nothing'. -- -- @since 1.1 type SubParam = Maybe Int -- | Type synonym representing parameter values optionally followed by a -- parameter substring. Parameter substrings were introduced by 13.1.8 of T.416 -- (03/93) for SGR parameter values 38 and 48 and have subsequently been adapted -- for other uses. -- -- @since 1.1 type ParamWithSubs = (Parameter, [SubParam]) -- | 'csi' @parameters controlFunction@, where @parameters@ is a list of 'Int', -- returns the control sequence comprising the control function CONTROL -- SEQUENCE INTRODUCER (CSI) followed by the parameter(s) (separated by \'@;@\') -- and ending with the @controlFunction@ character(s) that identifies the -- control function. See 'csi'' for a function that handles parameter values -- that may be followed by a parameter substring. csi :: [Parameter] -- ^ List of parameters for the control sequence. -> String -- ^ Character(s) that identify the control function. -> String csi = renderCsi show -- | Like 'csi' but extended to parameters that may be followed by a parameter -- substring. The parameter elements of a parameter substring are separated from -- the parameter value and each other by \'@:@\'. -- -- @since 1.1 csi' :: [ParamWithSubs] -- ^ List of parameters (each of which may be followed by a parameter -- substring). -> String -- ^ Characters(s) that identify the control function. -> String csi' = renderCsi render where render (p, []) = show p render (p, pes) = intercalate ":" (show p : map (maybe [] show) pes) -- | Helper function to render different types of parameters. renderCsi :: (a -> String) -> [a] -> String -> String renderCsi render args code = "\ESC[" ++ intercalate ";" (map render args) ++ code -- | 'osc' @parameterS parametersT@, where @parameterS@ specifies the type of -- operation to perform and @parametersT@ is the other parameter(s) (if any), -- returns the control sequence comprising the control function OPERATING SYSTEM -- COMMAND (OSC) followed by the parameters (separated by \';\') and ending with -- the STRING TERMINATOR (ST) @\"\\ESC\\\\\"@. -- -- @since 0.11.4 osc :: String -- ^ Ps parameter -> String -- ^ Pt parameter(s) -> String osc pS pT = "\ESC]" ++ pS ++ ";" ++ pT ++ "\ESC\\" -- | 'colorToCode' @color@ returns the 0-based index of the color (one of the -- eight colors in the ANSI standard). colorToCode :: Color -> Int colorToCode color = case color of Black -> 0 Red -> 1 Green -> 2 Yellow -> 3 Blue -> 4 Magenta -> 5 Cyan -> 6 White -> 7 -- | 'sgrToCode' @sgr@ returns the parameter of the SELECT GRAPHIC RENDITION -- (SGR) aspect identified by @sgr@. If the parameter is followed by a parameter -- substring returns an empty list. See 'sgrToCode'' for a function that handles -- also parameter values that are followed by a parameter substring. sgrToCode :: SGR -- ^ The SGR aspect -> [Parameter] sgrToCode sgr = case sgrToCode' sgr of Right args -> args Left _ -> [] -- | 'sgrToCode'' @sgr@ returns the parameter of the SELECT GRAPHIC RENDITION -- (SGR) aspect identified by @sgr@. -- -- @since 1.1 sgrToCode' :: SGR -- ^ The SGR aspect -> Either ParamWithSubs [Parameter] sgrToCode' sgr = case sgr of Reset -> Right [0] SetConsoleIntensity intensity -> case intensity of BoldIntensity -> Right [1] FaintIntensity -> Right [2] NormalIntensity -> Right [22] SetItalicized True -> Right [3] SetItalicized False -> Right [23] SetUnderlining underlining -> case underlining of SingleUnderline -> Right [4] DoubleUnderline -> Right [21] CurlyUnderline -> Left (4, [Just 3]) DottedUnderline -> Left (4, [Just 4]) DashedUnderline -> Left (4, [Just 5]) NoUnderline -> Right [24] SetBlinkSpeed blink_speed -> case blink_speed of SlowBlink -> Right [5] RapidBlink -> Right [6] NoBlink -> Right [25] SetVisible False -> Right [8] SetVisible True -> Right [28] SetSwapForegroundBackground True -> Right [7] SetSwapForegroundBackground False -> Right [27] SetColor Foreground Dull color -> Right [30 + colorToCode color] SetColor Foreground Vivid color -> Right [90 + colorToCode color] SetColor Background Dull color -> Right [40 + colorToCode color] SetColor Background Vivid color -> Right [100 + colorToCode color] SetColor Underlining Dull color -> Left (58, [Just 5, Just $ colorToCode color]) SetColor Underlining Vivid color -> Left (58, [Just 5, Just $ 8 + colorToCode color]) SetPaletteColor Foreground index -> Right [38, 5, fromIntegral index] SetPaletteColor Background index -> Right [48, 5, fromIntegral index] SetPaletteColor Underlining index -> Left (58, [Just 5, Just $ fromIntegral index]) SetRGBColor Foreground color -> Right $ [38, 2] ++ toRGB color SetRGBColor Background color -> Right $ [48, 2] ++ toRGB color SetRGBColor Underlining color -> Left (58, [Just 2, Nothing] ++ toRGB' color) SetDefaultColor Foreground -> Right [39] SetDefaultColor Background -> Right [49] SetDefaultColor Underlining -> Right [59] where toRGB color = let RGB r g b = toSRGB24 color in map fromIntegral [r, g, b] toRGB' = map Just . toRGB cursorUpCode, cursorDownCode, cursorForwardCode, cursorBackwardCode :: Int -- ^ Number of lines or characters to move -> String cursorUpCode n = if n == 0 then "" else csi [n] "A" cursorDownCode n = if n == 0 then "" else csi [n] "B" cursorForwardCode n = if n == 0 then "" else csi [n] "C" cursorBackwardCode n = if n == 0 then "" else csi [n] "D" cursorDownLineCode, cursorUpLineCode :: Int -- ^ Number of lines to move -> String cursorDownLineCode n = if n == 0 then csi [1] "G" else csi [n] "E" cursorUpLineCode n = if n == 0 then csi [1] "G" else csi [n] "F" -- | Code to move the cursor to the specified column. The column numbering is -- 0-based (that is, the left-most column is numbered 0). setCursorColumnCode :: Int -- ^ 0-based column to move to -> String setCursorColumnCode n = csi [n + 1] "G" -- | Code to move the cursor to the specified position (row and column). The -- position is 0-based (that is, the top-left corner is at row 0 column 0). setCursorPositionCode :: Int -- ^ 0-based row to move to -> Int -- ^ 0-based column to move to -> String setCursorPositionCode n m = csi [n + 1, m + 1] "H" -- | @since 0.7.1 saveCursorCode, restoreCursorCode :: String saveCursorCode = "\ESC7" restoreCursorCode = "\ESC8" -- | Code to emit the cursor position into the console input stream, immediately -- after being recognised on the output stream, as: -- @ESC [ \ ; \ R@ -- -- Note that the information that is emitted is 1-based (the top-left corner is -- at row 1 column 1) but 'setCursorPositionCode' is 0-based. -- -- In isolation of 'System.Console.ANSI.getReportedCursorPosition' or -- 'System.Console.ANSI.getCursorPosition', this function may be of limited use -- on Windows operating systems because of difficulties in obtaining the data -- emitted into the console input stream. -- -- @since 0.7.1 reportCursorPositionCode :: String reportCursorPositionCode = csi [] "6n" -- | Code to emit the foreground or backgrond layer color into the console input -- stream, immediately after being recognised on the output stream, as: -- -- @ESC ] \ ; rgb: \ ; \ ; \ \@ -- -- where @\@ is @10@ for 'Foreground' and @11@ for 'Background'; @\@, -- @\@ and @\@ are the color channel values in hexadecimal (4, 8, -- 12 and 16 bit values are possible, although 16 bit values are most common); -- and @\@ is the STRING TERMINATOR (ST). ST depends on the terminal -- software and may be the @BEL@ character or @ESC \\@ characters. -- -- This function may be of limited, or no, use on Windows operating systems -- because (1) the control character sequence is not supported on native -- terminals (2) of difficulties in obtaining the data emitted into the -- console input stream. See 'System.Console.ANSI.getReportedLayerColor'. -- -- Underlining is not supported. -- -- @since 0.11.4 reportLayerColorCode :: ConsoleLayer -> String reportLayerColorCode Foreground = osc "10" "?" reportLayerColorCode Background = osc "11" "?" reportLayerColorCode Underlining = [] -- Not supported. clearFromCursorToScreenEndCode, clearFromCursorToScreenBeginningCode, clearScreenCode :: String clearFromCursorToLineEndCode, clearFromCursorToLineBeginningCode, clearLineCode :: String clearFromCursorToScreenEndCode = csi [0] "J" clearFromCursorToScreenBeginningCode = csi [1] "J" clearScreenCode = csi [2] "J" clearFromCursorToLineEndCode = csi [0] "K" clearFromCursorToLineBeginningCode = csi [1] "K" clearLineCode = csi [2] "K" enableLineWrapCode, disableLineWrapCode :: String enableLineWrapCode = csi [] "?7h" disableLineWrapCode = csi [] "?7l" scrollPageUpCode, scrollPageDownCode :: Int -- ^ Number of lines to scroll by -> String scrollPageUpCode n = if n == 0 then "" else csi [n] "S" scrollPageDownCode n = if n == 0 then "" else csi [n] "T" useAlternateScreenBufferCode, useNormalScreenBufferCode :: String useAlternateScreenBufferCode = csi [] "?1049h" useNormalScreenBufferCode = csi [] "?1049l" setSGRCode :: [SGR] -- ^ Commands: these will typically be applied on top of the current -- console SGR mode. An empty list of commands is equivalent to the list -- @[Reset]@. Commands are applied left to right. -> String setSGRCode sgrs = csi' (concatMap sgrToCode'' sgrs) "m" where sgrToCode'' = either (:[]) (map (,[] :: [SubParam])) . sgrToCode' hideCursorCode, showCursorCode :: String hideCursorCode = csi [] "?25l" showCursorCode = csi [] "?25h" -- | Code to introduce a hyperlink with (key, value) parameters. Some terminals -- support an @id@ parameter key, so that hyperlinks with the same @id@ value -- are treated as connected. -- -- @since 0.11.3 hyperlinkWithParamsCode :: [(String, String)] -- ^ Parameters -> String -- ^ URI -> String -- ^ Link text -> String hyperlinkWithParamsCode params uri link = osc "8" pT ++ link ++ osc "8" ";" where pT = params' ++ ";" ++ uri params' = intercalate ":" $ map (\(k, v) -> k ++ "=" ++ v) params -- | Code to introduce a hyperlink. -- -- @since 0.11.3 hyperlinkCode :: String -- ^ URI -> String -- ^ Link text -> String hyperlinkCode = hyperlinkWithParamsCode [] -- | Code to introduce a hyperlink with an identifier for the link. Some -- terminals support an identifier, so that hyperlinks with the same identifier -- are treated as connected. -- -- @since 0.11.3 hyperlinkWithIdCode :: String -- ^ Identifier for the link -> String -- ^ URI -> String -- ^ Link text -> String hyperlinkWithIdCode linkId = hyperlinkWithParamsCode [("id", linkId)] -- | Code to set the terminal window title and the icon name (that is, the text -- for the window in the Start bar, or similar). -- Thanks to Brandon S. Allbery and Curt Sampson for pointing me in the right -- direction on xterm title setting on haskell-cafe. The "0" signifies that both -- the title and "icon" text should be set. This is chosen for consistent -- behaviour between Unixes and Windows. setTitleCode :: String -- ^ New window title and icon name -> String setTitleCode title = osc "0" (filter isPrint title) ansi-terminal-types-1.1.3/src/System/Console/ANSI/Types.hs0000644000000000000000000001725714601605161021472 0ustar0000000000000000{-# LANGUAGE Safe #-} {-| The \'ANSI\' standards refer to the visual style of displaying characters as their \'graphic rendition\'. The style includes the color of a character, its background, or (where supported) its underlining; the intensity (bold, normal or faint) of a character; or whether the character is italic or underlined (single, double, curly, dotted or dashed), blinking (slowly or rapidly) or visible or not. The \'ANSI\' codes to establish the graphic rendition for subsequent text are referred to as SELECT GRAPHIC RENDITION (SGR). This module exports types and functions used to represent SGR aspects. See also 'System.Console.ANSI.setSGR' and related functions provided by the @ansi-terminal@ package. -} module System.Console.ANSI.Types ( -- * Types used to represent SGR aspects SGR (..) , ConsoleLayer (..) , Color (..) , ColorIntensity (..) , ConsoleIntensity (..) , Underlining (..) , BlinkSpeed (..) -- * Constructors of xterm 256-color palette indices , xterm6LevelRGB , xterm24LevelGray , xtermSystem ) where import Data.Ix (Ix) import Data.Word (Word8) import Data.Colour (Colour) -- | ANSI's eight standard colors. They come in two intensities, which are -- controlled by 'ColorIntensity'. Many terminals allow the colors of the -- standard palette to be customised, so that, for example, -- @setSGR [ SetColor Foreground Vivid Green ]@ may not result in bright green -- characters. data Color = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White deriving (Bounded, Enum, Eq, Ix, Ord, Read, Show) -- | ANSI's standard colors come in two intensities data ColorIntensity = Dull | Vivid deriving (Bounded, Eq, Enum, Ix, Ord, Read, Show) -- | ANSI colors can be set on three different layers data ConsoleLayer = Foreground | Background | Underlining -- ^ Not widely supported. -- -- @since 1.1 deriving (Bounded, Eq, Enum, Ix, Ord, Read, Show) -- | ANSI blink speeds: values other than 'NoBlink' are not widely supported data BlinkSpeed = SlowBlink -- ^ Less than 150 blinks per minute | RapidBlink -- ^ More than 150 blinks per minute | NoBlink deriving (Bounded, Eq, Enum, Ix, Ord, Read, Show) -- | ANSI text underlining data Underlining = SingleUnderline | DoubleUnderline -- ^ Not widely supported. | CurlyUnderline -- ^ Not widely supported. -- -- @since 1.1 | DottedUnderline -- ^ Not widely supported. -- -- @since 1.1 | DashedUnderline -- ^ Not widely supported. -- -- @since 1.1 | NoUnderline deriving (Bounded, Eq, Enum, Ix, Ord, Read, Show) -- | ANSI general console intensity: usually treated as setting the font style -- (e.g. 'BoldIntensity' causes text to be bold) data ConsoleIntensity = BoldIntensity -- | Not widely supported: sometimes treated as concealing text. Not supported -- natively on Windows 10 | FaintIntensity | NormalIntensity deriving (Bounded, Eq, Enum, Ix, Ord, Read, Show) -- | ANSI Select Graphic Rendition (SGR) command -- -- In respect of colors, there are three alternative commands: -- -- (1) the \'ANSI\' standards allow for eight standard colors (with two -- intensities). Windows and many other terminals (including xterm) allow the -- user to redefine the standard colors (so, for example 'Vivid' 'Green' may not -- correspond to bright green; -- -- (2) an extension of the standard that allows true colors (24 bit color depth) -- in RGB space. This is usually the best alternative for more colors; and -- -- (3) another extension that allows a palette of 256 colors, each color -- specified by an index. Xterm provides a protocol for a palette of 256 colors -- that many other terminals, including Windows 10, follow. Some terminals -- (including xterm) allow the user to redefine some or all of the palette -- colors. data SGR -- | Default rendition, cancels the effect of any preceding occurrence of SGR -- (implementation-defined) = Reset -- | Set the character intensity. Partially supported natively on Windows 10 | SetConsoleIntensity !ConsoleIntensity -- | Set italicized. Not widely supported: sometimes treated as swapping -- foreground and background. Not supported natively on Windows 10 | SetItalicized !Bool -- | Set or clear underlining. Partially supported natively on Windows 10 | SetUnderlining !Underlining -- | Set or clear character blinking. Not supported natively on Windows 10 | SetBlinkSpeed !BlinkSpeed -- | Set revealed or concealed. Not widely supported. Not supported natively -- on Windows 10 | SetVisible !Bool -- | Set negative or positive image. Supported natively on Windows 10 | SetSwapForegroundBackground !Bool -- | Set a color from the standard palette of 16 colors (8 colors by 2 -- color intensities). Many terminals allow the palette colors to be -- customised | SetColor !ConsoleLayer !ColorIntensity !Color -- | Set a true color (24 bit color depth). Supported natively on Windows 10 -- from the Creators Update (April 2017) -- -- @since 0.7 | SetRGBColor !ConsoleLayer !(Colour Float) -- | Set a color from a palette of 256 colors using a numerical index -- (0-based). Supported natively on Windows 10 from the Creators Update (April -- 2017) but not on legacy Windows native terminals. See 'xtermSystem', -- 'xterm6LevelRGB' and 'xterm24LevelGray' to construct indices based on -- xterm's standard protocol for a 256-color palette. -- -- @since 0.9 | SetPaletteColor !ConsoleLayer !Word8 -- | Set a color to the default (implementation-defined) -- -- @since 0.10 | SetDefaultColor !ConsoleLayer deriving (Eq, Read, Show) -- | Given xterm's standard protocol for a 256-color palette, returns the index -- to that part of the palette which is a 6 level (6x6x6) color cube of 216 RGB -- colors. Throws an error if any of the red, green or blue channels is outside -- the range 0 to 5. An example of use is: -- -- >>> setSGR [ SetPaletteColor $ xterm6LevelRGB 5 2 0 ] -- Dark Orange -- -- @since 0.9 xterm6LevelRGB :: Int -> Int -> Int -> Word8 xterm6LevelRGB r g b -- RGB colors are represented by index: -- 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) | r >= 0 && r < 6 && g >= 0 && g < 6 && b >= 0 && b < 6 = fromIntegral $ 16 + 36 * r + 6 * g + b | otherwise = error $ show r ++ " " ++ show g ++ " " ++ show b ++ " (r g b) is " ++ "outside of a 6 level (6x6x6) color cube." -- | Given xterm's standard protocol for a 256-color palette, returns the index -- to that part of the palette which is a spectrum of 24 grays, from dark -- gray (0) to near white (23) (black and white are themselves excluded). Throws -- an error if the gray is outside of the range 0 to 23. An example of use is: -- -- >>> setSGR [ SetPaletteColor $ xterm24LevelGray 12 ] -- Gray50 -- -- @since 0.9 xterm24LevelGray :: Int -> Word8 xterm24LevelGray y -- Grayscale colors are represented by index: -- 232 + g (0 ≤ g ≤ 23) | y >= 0 && y < 24 = fromIntegral $ 232 + y | otherwise = error $ show y ++ " (gray) is outside of the range 0 to 23." -- | Given xterm's standard protocol for a 256-color palette, returns the index -- to that part of the palette which corresponds to the \'ANSI\' standards' 16 -- standard, or \'system\', colors (eight colors in two intensities). An example -- of use is: -- -- >>> setSGR [ SetPaletteColor $ xtermSystem Vivid Green ] -- -- @since 0.9 xtermSystem :: ColorIntensity -> Color -> Word8 xtermSystem intensity color | intensity == Dull = index | otherwise = index + 8 where index = fromIntegral $ fromEnum color ansi-terminal-types-1.1.3/CHANGELOG.md0000644000000000000000000000066515036525432015434 0ustar0000000000000000Changes ======= Version 1.1.3 ------------- * Expose `System.Console.ANSI.Codes`, spun out of the `ansi-terminal-1.1.2` package. Version 1.1 ----------- * Add `Underlining` constructor to type `ConsoleLayer`. * Add `CurlyUnderline`, `DottedUnderline`, and `DashedUnderline` constructors to type `Underlining`. Version 0.11.5 -------------- * Initial version, spun out of the `ansi-terminal-0.11.4` package. ansi-terminal-types-1.1.3/README.md0000644000000000000000000000175214405320467015100 0ustar0000000000000000ansi-terminal-types [![GitHub CI](https://github.com/UnkindPartition/ansi-terminal/workflows/CI/badge.svg)](https://github.com/UnkindPartition/ansi-terminal/actions) =================== A Haskell package providing types and functions used to represent SGR (SELECT GRAPHIC RENDITION) aspects of 'ANSI' control character sequences for terminals. Documentation ------------- Haddock documentation is available at [Hackage](http://hackage.haskell.org/packages/archive/ansi-terminal-types/latest/doc/html/System-Console-ANSI-Types.html). Credits ------- This package was spun out of the `ansi-terminal` package, a library originally written by [Max Bolingbroke](https://github.com/batterseapower) Maintainers ----------- [Mike Pilgrem](https://github.com/mpilgrem) and [Roman Cheplyaka](https://github.com/UnkindPartition) are the primary maintainers. [Oliver Charles](https://github.com/ocharles) is the backup maintainer. Please get in touch with him if the primary maintainers cannot be reached. ansi-terminal-types-1.1.3/LICENSE0000644000000000000000000000276614405320467014634 0ustar0000000000000000Copyright (c) 2008, Maximilian Bolingbroke All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Maximilian Bolingbroke nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ansi-terminal-types-1.1.3/ansi-terminal-types.cabal0000644000000000000000000000276315036525432020515 0ustar0000000000000000Cabal-Version: 1.22 Name: ansi-terminal-types Version: 1.1.3 Category: User Interfaces Synopsis: Types and functions used to represent SGR aspects Description: The \'ANSI\' standards refer to the visual style of displaying characters as their \'graphic rendition\'. The \'ANSI\' codes to establish the graphic rendition for subsequent text are referred to as SELECT GRAPHIC RENDITION (SGR). This package exposes modules that export types and functions used to represent SGR aspects. License: BSD3 License-File: LICENSE Author: Max Bolingbroke Maintainer: Mike Pilgrem , Roman Cheplyaka Homepage: https://github.com/UnkindPartition/ansi-terminal Build-Type: Simple Extra-Source-Files: CHANGELOG.md README.md Source-repository head type: git location: git://github.com/UnkindPartition/ansi-terminal.git Library Hs-Source-Dirs: src Exposed-Modules: System.Console.ANSI.Codes , System.Console.ANSI.Types Build-Depends: base >= 4.8.0.0 && < 5 , colour >= 2.1.0 Default-Extensions: CPP Ghc-Options: -Wall Default-Language: Haskell2010