table-layout-1.0.0.0: Format tabular data as grid or table.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Layout.Table.StringBuilder

Synopsis

Documentation

class Monoid a => StringBuilder a where Source #

A type that is used to construct parts of a table.

Minimal complete definition

stringB, charB

Methods

stringB :: String -> a Source #

Create a builder with a String.

charB :: Char -> a Source #

Create a builder with a single Char.

textB :: Text -> a Source #

Create a builder with a Text.

replicateCharB :: Int -> Char -> a Source #

Create a builder with several Chars.

Instances

Instances details
StringBuilder Text Source # 
Instance details

Defined in Text.Layout.Table.StringBuilder

Methods

stringB :: String -> Text Source #

charB :: Char -> Text Source #

textB :: Text -> Text Source #

replicateCharB :: Int -> Char -> Text Source #

StringBuilder Builder Source # 
Instance details

Defined in Text.Layout.Table.StringBuilder

Methods

stringB :: String -> Builder Source #

charB :: Char -> Builder Source #

textB :: Text -> Builder Source #

replicateCharB :: Int -> Char -> Builder Source #

StringBuilder String Source # 
Instance details

Defined in Text.Layout.Table.StringBuilder

Methods

stringB :: String -> String Source #

charB :: Char -> String Source #

textB :: Text -> String Source #

replicateCharB :: Int -> Char -> String Source #

StringBuilder (Endo String) Source # 
Instance details

Defined in Text.Layout.Table.StringBuilder

Methods

stringB :: String -> Endo String Source #

charB :: Char -> Endo String Source #

textB :: Text -> Endo String Source #

replicateCharB :: Int -> Char -> Endo String Source #

spacesB :: StringBuilder a => Int -> a Source #

Create a builder that contains k spaces. Negative numbers are treated as zero.

remSpacesB' Source #

Arguments

:: StringBuilder b 
=> Int

The expected length.

-> Int

The actual length.

-> b 

Creates a StringBuilder with the amount of missing spaces.