hledger-lib-1.50.3: A library providing the core functionality of hledger

Safe Haskell | None
Language | GHC2021

Text.WideString

Contents

- Text Builders which keep track of length

Description

Calculate the width of String and Text, being aware of wide characters.

Synopsis

- data WideBuilder = WideBuilder {
  - wbBuilder :: !Builder
  - wbWidth :: !Int
  }
- wbUnpack :: WideBuilder -> String
- wbToText :: WideBuilder -> Text
- wbFromText :: Text -> WideBuilder

# Text Builders which keep track of length

data WideBuilder Source #

Helper for constructing Builders while keeping track of text width.

Constructors

WideBuilder |

Fields

- wbBuilder :: !Builder
- wbWidth :: !Int

#### Instances

Instances details

Monoid WideBuilder Source # |
Instance details Defined in Text.WideString Methods mempty :: WideBuilder Source # mappend :: WideBuilder -> WideBuilder -> WideBuilder Source # mconcat :: [WideBuilder] -> WideBuilder Source #
Semigroup WideBuilder Source # |
Instance details Defined in Text.WideString Methods (<>) :: WideBuilder -> WideBuilder -> WideBuilder Source # sconcat :: NonEmpty WideBuilder -> WideBuilder Source # stimes :: Integral b => b -> WideBuilder -> WideBuilder Source #
Show WideBuilder Source # |
Instance details Defined in Text.WideString Methods showsPrec :: Int -> WideBuilder -> ShowS Source # show :: WideBuilder -> String Source # showList :: [WideBuilder] -> ShowS Source #

wbUnpack :: WideBuilder -> String Source #

Convert a WideBuilder to a String.

wbToText :: WideBuilder -> Text Source #

Convert a WideBuilder to a strict Text.

wbFromText :: Text -> WideBuilder Source #

Convert a strict Text to a WideBuilder.