f package:formatting

Render a floating point number using normal notation, with the given number of decimal places.
Combinator-based type-safe formatting (like printf() or FORMAT) Combinator-based type-safe formatting (like printf() or FORMAT), modelled from the HoleyMonoids package. See the README at https://github.com/AJChapman/formatting#readme for more info.
Run the formatter and return a lazy Text value.
Run the formatter and return a list of characters.
Makes it easy to add formatting to any api that is expecting a builder, a strict or lazy text, or a string. It is essentially (flip runFormat), but with a more generous type due to the typeclass. For example: >>> formatted TL.putStr ("x is: " % int % "n") 7 x is: 7 >>> formatted T.putStr ("x is: " % int % "n") 7 x is: 7 >>> formatted (id TL.Text) ("x is: " % int % "n") 7 "x is: 7n" >>> formatted (id T.Text) ("x is: " % int % "n") 7 "x is: 7n"
Run the formatter and print out the text to stdout.
Run the formatter and print out the text to stdout, followed by a newline.
Take a fractional number and floor it before formatting it as the given Format:
>>> format (flooredTo int) 6.66
"6"

>>> format (list (flooredTo int)) [10.66, 6.66, 1.0, 3.4]
"[10, 6, 1, 3]"
Note: the type variable f will almost always be 'Format r', so the type of this function can be thought of as:
flooredTo :: (Integral i, RealFrac d) => Format r (i -> r) -> Format r (d -> r)
Printing floating points.
Like const but for formatters.
Fit in the given length, truncating on the left.
Fit in the given length, truncating on the right.
Render a floating point number using normal notation, with the given number of decimal places.
Render some floating point with the usual notation, e.g. 123.32 => "123.32"
Render a floating point number using normal notation, with the given number of decimal places.
Formatter call. Probably don't want to use this.
Combinator-based type-safe formatting (like printf() or FORMAT) for Text. Example:
>>> format ("Person's name is " % text % ", age is " % hex) "Dave" 54
"Person's name is Dave, age is 36"
See Formatting.Formatters for a list of formatters. See Formatting.Combinators for a list of formatting combinators, for combining and altering formatters.
A formatter. When you construct formatters the first type parameter, r, will remain polymorphic. The second type parameter, a, will change to reflect the types of the data that will be formatted. For example, in
myFormat :: Format r (Text -> Int -> r)
myFormat = "Person's name is " % text % ", age is " % hex
the first type parameter remains polymorphic, and the second type parameter is Text -> Int -> r, which indicates that it formats a Text and an Int. When you run the Format, for example with format, you provide the arguments and they will be formatted into a string.
> format ("Person's name is " % text % ", age is " % hex) "Dave" 54
"Person's name is Dave, age is 36"
Formatting functions.
Anything that can be created from a Builder. This class makes it easier to add formatting to other API's. See formatted for some examples of this class in action.
A formatter. When you construct formatters the first type parameter, r, will remain polymorphic. The second type parameter, a, will change to reflect the types of the data that will be formatted. For example, in
myFormat :: Format r (Text -> Int -> r)
myFormat = "Person's name is " % text % ", age is " % hex
the first type parameter remains polymorphic, and the second type parameter is Text -> Int -> r, which indicates that it formats a Text and an Int. When you run the Format, for example with format, you provide the arguments and they will be formatted into a string.
> format ("Person's name is " % text % ", age is " % hex) "Dave" 54
"Person's name is Dave, age is 36"
Run the formatter and return a Builder value. This is a newer synonym for bprint, following the naming convention set by format and sformat.