module Text.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 Data.Text (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 :: Text -> Text
black :: Text -> Text
black =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.black
{-# INLINE black #-}
red :: Text -> Text
red :: Text -> Text
red =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.red
{-# INLINE red #-}
green :: Text -> Text
green :: Text -> Text
green =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.green
{-# INLINE green #-}
yellow :: Text -> Text
yellow :: Text -> Text
yellow =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.yellow
{-# INLINE yellow #-}
blue :: Text -> Text
blue :: Text -> Text
blue =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.blue
{-# INLINE blue #-}
magenta :: Text -> Text
magenta :: Text -> Text
magenta =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.magenta
{-# INLINE magenta #-}
cyan :: Text -> Text
cyan :: Text -> Text
cyan =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.cyan
{-# INLINE cyan #-}
white :: Text -> Text
white :: Text -> Text
white =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.white
{-# INLINE white #-}
brightBlack :: Text -> Text
brightBlack :: Text -> Text
brightBlack =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightBlack
{-# INLINE brightBlack #-}
brightRed :: Text -> Text
brightRed :: Text -> Text
brightRed =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightRed
{-# INLINE brightRed #-}
brightGreen :: Text -> Text
brightGreen :: Text -> Text
brightGreen =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightGreen
{-# INLINE brightGreen #-}
brightYellow :: Text -> Text
brightYellow :: Text -> Text
brightYellow =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightYellow
{-# INLINE brightYellow #-}
brightBlue :: Text -> Text
brightBlue :: Text -> Text
brightBlue =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightBlue
{-# INLINE brightBlue #-}
brightMagenta :: Text -> Text
brightMagenta :: Text -> Text
brightMagenta =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightMagenta
{-# INLINE brightMagenta #-}
brightCyan :: Text -> Text
brightCyan :: Text -> Text
brightCyan =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightCyan
{-# INLINE brightCyan #-}
brightWhite :: Text -> Text
brightWhite :: Text -> Text
brightWhite =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightWhite
{-# INLINE brightWhite #-}
rgb :: Word8 -> Word8 -> Word8 -> Text -> Text
rgb :: Word8 -> Word8 -> Word8 -> Text -> Text
rgb Word8
r Word8
g Word8
b =
(Builder -> Builder) -> Text -> Text
lift (Word8 -> Word8 -> Word8 -> Builder -> Builder
Builder.ANSI.rgb Word8
r Word8
g Word8
b)
{-# INLINE rgb #-}
blackBg :: Text -> Text
blackBg :: Text -> Text
blackBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.blackBg
{-# INLINE blackBg #-}
redBg :: Text -> Text
redBg :: Text -> Text
redBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.redBg
{-# INLINE redBg #-}
greenBg :: Text -> Text
greenBg :: Text -> Text
greenBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.greenBg
{-# INLINE greenBg #-}
yellowBg :: Text -> Text
yellowBg :: Text -> Text
yellowBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.yellowBg
{-# INLINE yellowBg #-}
blueBg :: Text -> Text
blueBg :: Text -> Text
blueBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.blueBg
{-# INLINE blueBg #-}
magentaBg :: Text -> Text
magentaBg :: Text -> Text
magentaBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.magentaBg
{-# INLINE magentaBg #-}
cyanBg :: Text -> Text
cyanBg :: Text -> Text
cyanBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.cyanBg
{-# INLINE cyanBg #-}
whiteBg :: Text -> Text
whiteBg :: Text -> Text
whiteBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.whiteBg
{-# INLINE whiteBg #-}
brightBlackBg :: Text -> Text
brightBlackBg :: Text -> Text
brightBlackBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightBlackBg
{-# INLINE brightBlackBg #-}
brightRedBg :: Text -> Text
brightRedBg :: Text -> Text
brightRedBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightRedBg
{-# INLINE brightRedBg #-}
brightGreenBg :: Text -> Text
brightGreenBg :: Text -> Text
brightGreenBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightGreenBg
{-# INLINE brightGreenBg #-}
brightYellowBg :: Text -> Text
brightYellowBg :: Text -> Text
brightYellowBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightYellowBg
{-# INLINE brightYellowBg #-}
brightBlueBg :: Text -> Text
brightBlueBg :: Text -> Text
brightBlueBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightBlueBg
{-# INLINE brightBlueBg #-}
brightMagentaBg :: Text -> Text
brightMagentaBg :: Text -> Text
brightMagentaBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightMagentaBg
{-# INLINE brightMagentaBg #-}
brightCyanBg :: Text -> Text
brightCyanBg :: Text -> Text
brightCyanBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightCyanBg
{-# INLINE brightCyanBg #-}
brightWhiteBg :: Text -> Text
brightWhiteBg :: Text -> Text
brightWhiteBg =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.brightWhiteBg
{-# INLINE brightWhiteBg #-}
rgbBg :: Word8 -> Word8 -> Word8 -> Text -> Text
rgbBg :: Word8 -> Word8 -> Word8 -> Text -> Text
rgbBg Word8
r Word8
g Word8
b =
(Builder -> Builder) -> Text -> Text
lift (Word8 -> Word8 -> Word8 -> Builder -> Builder
Builder.ANSI.rgbBg Word8
r Word8
g Word8
b)
{-# INLINE rgbBg #-}
bold :: Text -> Text
bold :: Text -> Text
bold =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.bold
{-# INLINE bold #-}
faint :: Text -> Text
faint :: Text -> Text
faint =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.faint
{-# INLINE faint #-}
italic :: Text -> Text
italic :: Text -> Text
italic =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.italic
{-# INLINE italic #-}
underline :: Text -> Text
underline :: Text -> Text
underline =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.underline
{-# INLINE underline #-}
doubleUnderline :: Text -> Text
doubleUnderline :: Text -> Text
doubleUnderline =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.doubleUnderline
{-# INLINE doubleUnderline #-}
strikethrough :: Text -> Text
strikethrough :: Text -> Text
strikethrough =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.strikethrough
{-# INLINE strikethrough #-}
frame :: Text -> Text
frame :: Text -> Text
frame =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.frame
{-# INLINE frame #-}
encircle :: Text -> Text
encircle :: Text -> Text
encircle =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.encircle
{-# INLINE encircle #-}
overline :: Text -> Text
overline :: Text -> Text
overline =
(Builder -> Builder) -> Text -> Text
lift Builder -> Builder
Builder.ANSI.overline
{-# INLINE overline #-}
lift :: (Builder -> Builder) -> Text -> Text
lift :: (Builder -> Builder) -> Text -> Text
lift Builder -> Builder
f =
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
. Text -> Builder
Builder.fromText
{-# NOINLINE [2] lift #-}
{-# RULES
"lift/lift" [~2] forall f g s.
lift f (lift g s) =
lift (f . g) s
#-}