Popularity
6.1
Growing
Activity
0.0
Stable
14
3
2

Monthly Downloads: 37
Programming language: Haskell
License: MIT License
Tags: Text    
Latest version: v0.7.0

th-printf alternatives and similar packages

Based on the "Text" category.
Alternatively, view th-printf alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of th-printf or a related project?

Add another 'Text' Package

README

th-printf th-printf th-printf

printf QuasiQuoters

Usage

import Language.Haskell.Printf

-- String interpolation
[s|Hello, %s!|] "Jeff" -- "Hello, Jeff!"

-- Text interpolation
[s|Hello, %q!|] (Data.Text.Lazy.pack "Jeff") -- "Hello, Jeff!"

-- Width specifiers
[s|%010d|] 1977 -- "0000001977"

-- Different radices
[s|%d, %x, %o, %#x, %#o|] 100 100 100 100 100 -- "100, 64, 144, 0x64, 0144"

-- Variable-width formatting
[s|%0*d|] 5 10 -- "00010"

There's also another format specifier %?, which accepts any Showable datatype.