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

PortabilityGHC
Stabilityexperimental
Maintainerchrisdone@gmail.com
Safe HaskellNone

Formatting.Formatters

Contents

Description

Formatting functions.

Synopsis

Formatters

text :: Format TextSource

Output a lazy text.

hex :: Format IntegerSource

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

stext :: Format TextSource

Output a strict text.

string :: Format StringSource

Output a string.

expt :: Real a => Int -> Format aSource

Render a floating point number using scientific/engineering notation (e.g. 2.3e123), with the given number of decimal places.

fixed :: Real a => Int -> Format aSource

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

prec :: Real a => Int -> Format aSource

Render a floating point number, with the given number of digits of precision. Uses decimal notation for values between 0.1 and 9,999,999, and scientific notation otherwise.

shortest :: Real a => Format aSource

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

left :: Buildable a => Int -> Char -> Format aSource

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

right :: Buildable a => Int -> Char -> Format aSource

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