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

Copyright(c) 2013 Chris Done, 2013 Shachaf Ben-Kiki
LicenseBSD3
Maintainerchrisdone@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell98

Formatting

Contents

Description

Combinator-based type-safe formatting (like printf() or FORMAT) for Text.

Example:

>>> format ("Person's name is " % text % ", age is " % hex) "Dave" 54

See Formatting.Formatters for a complete list of formatting combinators.

Synopsis

Top-level functions

format :: Holey Builder Text a -> a Source

Run the formatter and return a lazy Text value.

sformat :: Holey Builder Text a -> a Source

Run the formatter and return a strict Text value.

bprint :: Holey Builder Builder a -> a Source

Run the formatter and return a Builder value.

fprint :: Holey Builder (IO ()) a -> a Source

Run the formatter and print out the text to stdout.

hprint :: Handle -> Holey Builder (IO ()) a -> a Source

Run the formatter and put the output onto the given Handle.

Formatting library