th-printf-0.2.0.1: Compile-time printf

Safe HaskellNone

Text.Printf.TH

Description

A module with behavior as close to realistically possible to C printf, including variadic width and precision specifiers.

The only thing you don't get with this package is printing pointers (although if you really want this behavior, send a pull request).

Synopsis

Documentation

s :: QuasiQuoterSource

A formatter that produces a String.

>>> [s|%s %d %.3f|] "foobar" 10 1.23456
"foobar 10 1.235"

st :: QuasiQuoterSource

A formatter that produces Text. See s.

lt :: QuasiQuoterSource

A formatter that produces lazy Text. See s.

sb :: QuasiQuoterSource

A formatter that produces ByteString. See s.

lb :: QuasiQuoterSource

A formatter that produces lazy ByteString. See s.

sP :: QuasiQuoterSource

A formatter that produces and prints a String.

>>> [s|%s %d %.3f|] "foobar" 10 1.23456
<IO ()>

This formatter WILL output a newline after the expanded string. If you don't want this behavior, use s and putStr the result.

stP :: QuasiQuoterSource

A formatter that produces and prints Text. See sP.

ltP :: QuasiQuoterSource

A formatter that produces and prints lazy Text. See sP.

sbP :: QuasiQuoterSource

A formatter that produces and prints ByteString. See sP.

lbP :: QuasiQuoterSource

A formatter that produces and prints lazy ByteString. See sP.