HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulevty-6.6Haskell2010

Graphics.Text.Width

This module provides functions to measure the terminal column width of characters and strings.

The functions provided in this module all ultimately make calls to the C implementation in cbits/mk_wcwidth.c. That code manages some global state that carries a table of Unicode character widths. For more details, see Graphics.Vty.UnicodeWidthTable.Install, the C code, and the "Multi-Column Character Support" section of the project README.

  • 8 values
  • Packagevty-6.6
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceWidth.hs
valuesafeWcwidth :: Char -> Int
#

Returns the display width of a character. Assumes all characters with unknown widths are 0 width.

valuesafeWcswidth :: String -> Int
#

Returns the display width of a string. Assumes all characters with unknown widths are 0 width.

valuesafeWctwidth :: Text -> Int
#

Returns the display width of a text. Assumes all characters with unknown widths are 0 width.

valuesafeWctlwidth :: Text -> Int
#

Returns the display width of a lazy text. Assumes all characters with unknown widths are 0 width.