module String.ANSI
(
black,
red,
green,
yellow,
blue,
magenta,
cyan,
white,
brightBlack,
brightRed,
brightGreen,
brightYellow,
brightBlue,
brightMagenta,
brightCyan,
brightWhite,
rgb,
blackBg,
redBg,
greenBg,
yellowBg,
blueBg,
magentaBg,
cyanBg,
whiteBg,
brightBlackBg,
brightRedBg,
brightGreenBg,
brightYellowBg,
brightBlueBg,
brightMagentaBg,
brightCyanBg,
brightWhiteBg,
rgbBg,
bold,
faint,
italic,
underline,
doubleUnderline,
strikethrough,
frame,
encircle,
overline,
)
where
import qualified Data.Text as Text
import Data.Text.Builder.Linear (Builder)
import qualified Data.Text.Builder.Linear as Builder
import Data.Word (Word8)
import qualified Text.Builder.ANSI as Builder.ANSI
black :: String -> String
black :: String -> String
black =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.black
{-# INLINE black #-}
red :: String -> String
red :: String -> String
red =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.red
{-# INLINE red #-}
green :: String -> String
green :: String -> String
green =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.green
{-# INLINE green #-}
yellow :: String -> String
yellow :: String -> String
yellow =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.yellow
{-# INLINE yellow #-}
blue :: String -> String
blue :: String -> String
blue =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.blue
{-# INLINE blue #-}
magenta :: String -> String
magenta :: String -> String
magenta =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.magenta
{-# INLINE magenta #-}
cyan :: String -> String
cyan :: String -> String
cyan =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.cyan
{-# INLINE cyan #-}
white :: String -> String
white :: String -> String
white =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.white
{-# INLINE white #-}
brightBlack :: String -> String
brightBlack :: String -> String
brightBlack =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightBlack
{-# INLINE brightBlack #-}
brightRed :: String -> String
brightRed :: String -> String
brightRed =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightRed
{-# INLINE brightRed #-}
brightGreen :: String -> String
brightGreen :: String -> String
brightGreen =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightGreen
{-# INLINE brightGreen #-}
brightYellow :: String -> String
brightYellow :: String -> String
brightYellow =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightYellow
{-# INLINE brightYellow #-}
brightBlue :: String -> String
brightBlue :: String -> String
brightBlue =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightBlue
{-# INLINE brightBlue #-}
brightMagenta :: String -> String
brightMagenta :: String -> String
brightMagenta =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightMagenta
{-# INLINE brightMagenta #-}
brightCyan :: String -> String
brightCyan :: String -> String
brightCyan =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightCyan
{-# INLINE brightCyan #-}
brightWhite :: String -> String
brightWhite :: String -> String
brightWhite =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightWhite
{-# INLINE brightWhite #-}
rgb :: Word8 -> Word8 -> Word8 -> String -> String
rgb :: Word8 -> Word8 -> Word8 -> String -> String
rgb Word8
r Word8
g Word8
b =
(Builder -> Builder) -> String -> String
lift (Word8 -> Word8 -> Word8 -> Builder -> Builder
Builder.ANSI.rgb Word8
r Word8
g Word8
b)
{-# INLINE rgb #-}
blackBg :: String -> String
blackBg :: String -> String
blackBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.blackBg
{-# INLINE blackBg #-}
redBg :: String -> String
redBg :: String -> String
redBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.redBg
{-# INLINE redBg #-}
greenBg :: String -> String
greenBg :: String -> String
greenBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.greenBg
{-# INLINE greenBg #-}
yellowBg :: String -> String
yellowBg :: String -> String
yellowBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.yellowBg
{-# INLINE yellowBg #-}
blueBg :: String -> String
blueBg :: String -> String
blueBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.blueBg
{-# INLINE blueBg #-}
magentaBg :: String -> String
magentaBg :: String -> String
magentaBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.magentaBg
{-# INLINE magentaBg #-}
cyanBg :: String -> String
cyanBg :: String -> String
cyanBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.cyanBg
{-# INLINE cyanBg #-}
whiteBg :: String -> String
whiteBg :: String -> String
whiteBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.whiteBg
{-# INLINE whiteBg #-}
brightBlackBg :: String -> String
brightBlackBg :: String -> String
brightBlackBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightBlackBg
{-# INLINE brightBlackBg #-}
brightRedBg :: String -> String
brightRedBg :: String -> String
brightRedBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightRedBg
{-# INLINE brightRedBg #-}
brightGreenBg :: String -> String
brightGreenBg :: String -> String
brightGreenBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightGreenBg
{-# INLINE brightGreenBg #-}
brightYellowBg :: String -> String
brightYellowBg :: String -> String
brightYellowBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightYellowBg
{-# INLINE brightYellowBg #-}
brightBlueBg :: String -> String
brightBlueBg :: String -> String
brightBlueBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightBlueBg
{-# INLINE brightBlueBg #-}
brightMagentaBg :: String -> String
brightMagentaBg :: String -> String
brightMagentaBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightMagentaBg
{-# INLINE brightMagentaBg #-}
brightCyanBg :: String -> String
brightCyanBg :: String -> String
brightCyanBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightCyanBg
{-# INLINE brightCyanBg #-}
brightWhiteBg :: String -> String
brightWhiteBg :: String -> String
brightWhiteBg =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.brightWhiteBg
{-# INLINE brightWhiteBg #-}
rgbBg :: Word8 -> Word8 -> Word8 -> String -> String
rgbBg :: Word8 -> Word8 -> Word8 -> String -> String
rgbBg Word8
r Word8
g Word8
b =
(Builder -> Builder) -> String -> String
lift (Word8 -> Word8 -> Word8 -> Builder -> Builder
Builder.ANSI.rgbBg Word8
r Word8
g Word8
b)
{-# INLINE rgbBg #-}
bold :: String -> String
bold :: String -> String
bold =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.bold
{-# INLINE bold #-}
faint :: String -> String
faint :: String -> String
faint =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.faint
{-# INLINE faint #-}
italic :: String -> String
italic :: String -> String
italic =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.italic
{-# INLINE italic #-}
underline :: String -> String
underline :: String -> String
underline =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.underline
{-# INLINE underline #-}
doubleUnderline :: String -> String
doubleUnderline :: String -> String
doubleUnderline =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.doubleUnderline
{-# INLINE doubleUnderline #-}
strikethrough :: String -> String
strikethrough :: String -> String
strikethrough =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.strikethrough
{-# INLINE strikethrough #-}
frame :: String -> String
frame :: String -> String
frame =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.frame
{-# INLINE frame #-}
encircle :: String -> String
encircle :: String -> String
encircle =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.encircle
{-# INLINE encircle #-}
overline :: String -> String
overline :: String -> String
overline =
(Builder -> Builder) -> String -> String
lift Builder -> Builder
Builder.ANSI.overline
{-# INLINE overline #-}
lift :: (Builder -> Builder) -> String -> String
lift :: (Builder -> Builder) -> String -> String
lift Builder -> Builder
f =
Text -> String
Text.unpack forall b c a. (b -> c) -> (a -> b) -> a -> c
. Builder -> Text
Builder.runBuilder forall b c a. (b -> c) -> (a -> b) -> a -> c
. Builder -> Builder
f forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap Char -> Builder
Builder.fromChar
{-# NOINLINE [2] lift #-}
{-# RULES
"lift/lift" [~2] forall f g s.
lift f (lift g s) =
lift (f . g) s
#-}