formatting-7.2.0: Combinator-based type-safe formatting (like printf() or FORMAT)

Copyright | (c) 2013 Chris Done 2013 Shachaf Ben-Kiki
License | BSD3
Maintainer | chrisdone@gmail.com
Stability | experimental
Portability | GHC
Safe Haskell | None
Language | Haskell2010

Formatting.ShortFormatters

Description

Single letters for short formatting.

Synopsis

- t :: Format r (Text -> r)
- d :: Integral a => Format r (a -> r)
- b :: Integral a => Format r (a -> r)
- o :: Integral a => Format r (a -> r)
- x :: Integral a => Format r (a -> r)
- st :: Format r (Text -> r)
- s :: Format r (String -> r)
- sh :: Show a => Format r (a -> r)
- c :: Format r (Char -> r)
- f :: Real a => Int -> Format r (a -> r)
- sf :: Real a => Format r (a -> r)
- l :: Buildable a => Int -> Char -> Format r (a -> r)
- r :: Buildable a => Int -> Char -> Format r (a -> r)

# Documentation

t :: Format r (Text -> r) Source #

Output a lazy text.

d :: Integral a => Format r (a -> r) Source #

Render an integral e.g. 123 -> "123", 0 -> "0".

b :: Integral a => Format r (a -> r) Source #

Render an integer using binary notation. (No leading 0b is added.)

o :: Integral a => Format r (a -> r) Source #

Render an integer using octal notation. (No leading 0o is added.)

x :: Integral a => Format r (a -> r) Source #

Render an integer using hexadecimal notation. (No leading 0x is added.)

st :: Format r (Text -> r) Source #

Output a strict text.

s :: Format r (String -> r) Source #

Output a string.

sh :: Show a => Format r (a -> r) Source #

Output a showable value (instance of `Show`) by turning it into `Text`.

c :: Format r (Char -> r) Source #

Output a character.

f :: Real a => Int -> Format r (a -> r) Source #

Render a floating point number using normal notation, with the given number of decimal places.

sf :: Real a => Format r (a -> r) Source #

Render a floating point number using the smallest number of digits that correctly represent it.

l :: Buildable a => Int -> Char -> Format r (a -> r) Source #

Pad the left hand side of a string until it reaches `k` characters wide, if necessary filling with character `ch`.

r :: Buildable a => Int -> Char -> Format r (a -> r) Source #

Pad the right hand side of a string until it reaches `k` characters wide, if necessary filling with character `ch`.