colorful-monoids 0.2.0.1 → 0.2.1.0
raw patch · 7 files changed
+41/−41 lines, 7 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Monoid.Colorful: Under :: Style
- Data.Monoid.Colorful.Flat: Under :: Style
+ Data.Monoid.Colorful: Underline :: Style
+ Data.Monoid.Colorful.Flat: Underline :: Style
Files
- colorful-monoids.cabal +1/−1
- example.hs +9/−9
- src/Data/Monoid/Colorful.hs +4/−4
- src/Data/Monoid/Colorful/Color.hs +5/−5
- src/Data/Monoid/Colorful/Flat.hs +2/−2
- src/Data/Monoid/Colorful/SGR.hs +7/−7
- src/Data/Monoid/Colorful/Settings.hs +13/−13
colorful-monoids.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: colorful-monoids-version: 0.2.0.1+version: 0.2.1.0 synopsis: Styled console text output using ANSI escape sequences. description: Styled console text output using ANSI escape sequences. category: Text, User Interfaces, Monad
example.hs view
@@ -28,7 +28,7 @@ ansiColorsExample :: IO () ansiColorsExample = do term <- getTerm- printColoredS term $ Style Under $ Style Bold "ANSI Example\n"+ printColoredS term $ Style Underline $ Style Bold "ANSI Example\n" for_ ansiColors $ \c -> do printColoredIO term $ Bg c (Value $ printf "%-15s" $ show c) <> Fg c (Value $ printf "%-15s" $ show c)@@ -43,7 +43,7 @@ colors256Example :: IO () colors256Example = do term <- getTerm- printColoredS term $ Style Under $ Style Bold "Color256 Example\n"+ printColoredS term $ Style Underline $ Style Bold "Color256 Example\n" for_ [0..255] $ \c -> do printColoredS term $ Bg (Color256 c) (Value $ printf "%02x" c) <> Fg (Color256 c) (Value $ printf " %02x" c)@@ -54,7 +54,7 @@ rgbExample :: IO () rgbExample = do term <- getTerm- printColoredS term $ Style Under $ Style Bold "RGB Example\n"+ printColoredS term $ Style Underline $ Style Bold "RGB Example\n" for_ [0,64..255] $ \r -> for_ [0,64..255] $ \g -> for_ [0,64..255] $ \b -> do@@ -68,8 +68,8 @@ specialExample :: IO () specialExample = do term <- getTerm- printColoredS term $ Style Under $ Style Bold "Special Example\n"- for_ [Bold,Italic,Under,Invert,Blink] $ \a -> do+ printColoredS term $ Style Underline $ Style Bold "Special Example\n"+ for_ [Bold,Italic,Underline,Invert,Blink] $ \a -> do printColoredS term $ Style a (Value (printf "%-20s" $ show a) <> Unstyle a (Value $ printf " %-20s" $ "Not" ++ show a) <>@@ -79,7 +79,7 @@ stackExample :: IO () stackExample = do term <- getTerm- printColoredS term $ Style Under (Style Bold "Stack Example\n") <> loop 0+ printColoredS term $ Style Underline (Style Bold "Stack Example\n") <> loop 0 putChar '\n' where loop 8 = mempty@@ -92,15 +92,15 @@ basicExample :: IO () basicExample = do term <- getTerm- printColoredS term $ Style Under (Style Bold "Basic Example\n")+ printColoredS term $ Style Underline (Style Bold "Basic Example\n") <> Style Bold "Bold" <> Style Italic (Bg Red "Italic Red")- <> Style Under "Under"+ <> Style Underline "Underline" putChar '\n' reduceExample :: IO () reduceExample = do- printColoredS Term8 $ Style Under $ Style Bold "Reduction Example\n"+ printColoredS Term8 $ Style Underline $ Style Bold "Reduction Example\n" for_ [0..255] $ \c -> do printColoredS Term256 $ Bg (Color256 c) $ Value $ printf "%02x" c printColoredS Term8 $ Bg (Color256 c) $ Value $ printf "%02x" c
src/Data/Monoid/Colorful.hs view
@@ -29,10 +29,10 @@ -- > basicExample :: IO () -- > basicExample = do -- > term <- getTerm--- > printColoredS term $ Style Under (Style Bold "Basic Example\n")+-- > printColoredS term $ Style Underline (Style Bold "Basic Example\n") -- > <> Style Bold "Bold" -- > <> Style Italic (Bg Red "Italic Red")--- > <> Style Under "Under"+-- > <> Style Underline "Underline" -- > putChar '\n' -- -- For many more examples, see the@@ -50,7 +50,7 @@ , hGetTerm , getTerm - -- ** Colorful printing to file handle+ -- * Colorful printing to file handle , hPrintColored , printColored , hPrintColoredIO@@ -58,7 +58,7 @@ , hPrintColoredS , printColoredS - -- ** Show with ANSI escape sequences+ -- * Show with ANSI escape sequences , showColored , showColoredM , showColoredS
src/Data/Monoid/Colorful/Color.hs view
@@ -13,11 +13,11 @@ -- | Rendering style data Style- = Bold -- ^ Bold font- | Italic -- ^ Italic font- | Under -- ^ Underlined text- | Invert -- ^ Invert foreground and background color- | Blink -- ^ Blinking+ = Bold -- ^ Bold font+ | Italic -- ^ Italic font+ | Underline -- ^ Underlined text+ | Invert -- ^ Invert foreground and background color+ | Blink -- ^ Blinking deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic) -- | Named colors, 256 and RGB colors for more capable terminals.
src/Data/Monoid/Colorful/Flat.hs view
@@ -33,7 +33,7 @@ , hGetTerm , getTerm - -- ** Colorful printing to file handle+ -- * Colorful printing to file handle , hPrintColored , printColored , hPrintColoredIO@@ -41,7 +41,7 @@ , hPrintColoredS , printColoredS - -- ** Show with ANSI escape sequences+ -- * Show with ANSI escape sequences , showColored , showColoredM , showColoredS
src/Data/Monoid/Colorful/SGR.hs view
@@ -25,13 +25,13 @@ | old == new = "" | new == defaultSettings = csi 'm' [] | otherwise = csi 'm' $- (flag settingBlink 5 .- flag settingBold 1 .- flag settingItalic 3 .- flag settingUnder 4 .- flag settingInvert 7 .- color settingFg 0 .- color settingBg 10) []+ (flag settingBlink 5 .+ flag settingBold 1 .+ flag settingItalic 3 .+ flag settingUnderline 4 .+ flag settingInvert 7 .+ color settingFg 0 .+ color settingBg 10) [] where
src/Data/Monoid/Colorful/Settings.hs view
@@ -10,7 +10,7 @@ data Settings = Settings { settingBold :: !Bool , settingItalic :: !Bool- , settingUnder :: !Bool+ , settingUnderline :: !Bool , settingInvert :: !Bool , settingBlink :: !Bool , settingFg :: !Color@@ -21,21 +21,21 @@ defaultSettings :: Settings defaultSettings = Settings- { settingBold = False- , settingItalic = False- , settingInvert = False- , settingUnder = False- , settingBlink = False- , settingFg = DefaultColor- , settingBg = DefaultColor+ { settingBold = False+ , settingItalic = False+ , settingInvert = False+ , settingUnderline = False+ , settingBlink = False+ , settingFg = DefaultColor+ , settingBg = DefaultColor } setStyle :: Style -> Bool -> Settings -> Settings-setStyle Bold b s = s { settingBold = b }-setStyle Italic b s = s { settingItalic = b }-setStyle Under b s = s { settingUnder = b }-setStyle Invert b s = s { settingInvert = b }-setStyle Blink b s = s { settingBlink = b }+setStyle Bold b s = s { settingBold = b }+setStyle Italic b s = s { settingItalic = b }+setStyle Underline b s = s { settingUnderline = b }+setStyle Invert b s = s { settingInvert = b }+setStyle Blink b s = s { settingBlink = b } {-# INLINE setStyle #-} setBg, setFg :: Color -> Settings -> Settings