HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulesafe-coloured-text-0.3.0.2Haskell2010

Text.Colour

Safe Coloured Text

This module is responsible for defining, building, and rendering coloured text.

The text to be coloured is Text, but the rendered text, while technically still (probably) valid Utf8, will be a ByteString builder.

  • 3 types
  • 48 values

Building chunks

2 declarations
valuechunk :: Text -> Chunk
#

Turn a text into a plain chunk, without any styling

datadata Chunk
#
Instances6Eq, Show, IsString, Generic, Validity, Rep

Styling

Setting colour

Setting non-colour attributes

Colours

datadata Colour
#
Instances5Eq, Show, Generic, Validity, Rep

8-colour

Dull

Bright

8-bit

24-bit

Rendering

0 declarations

Composing chunks

valueunlinesChunks :: [[Chunk]] -> [Chunk]
#

Render lines of chunks.

This puts newlines ("n") at the end of every list of chunks.

valueunwordsChunks :: [[Chunk]] -> [Chunk]
#

Render lines of chunks.

This puts newlines (" ") inbetween the list of chunks.

Rendering chunks to strict bytestring in UTF8

Rendering chunks to lazy bytestring builders in UTF8

Rendering chunks to strict Text

Rendering chunks to lazy text

Rendering chunks to lazy text builder

IO

1 declaration
datadata TerminalCapabilities
#

Constructors

Instances5Eq, Ord, Show, Generic, Rep

Outputting chunks directly