Copyright © 2013 Bart Massey
XXX This package is deprecated as of 2013-09-18. The good
news is that it is deprecated because it is expected to
replace Text.Printf
in GHC 7.8. So feel free to try it out
from here, but expect to use it from there in the very near
future.
This is a filled-out Haskell Text.Printf
implementation
enhanced to allow extending printf
to new datatypes. It
was originally inspired by my need for such a thing, and by
finding this two-message email-list
thread
from May 2006 in which John Meacham and Simon Marlow suggest
an implementation.
The tests are not here. Rather, they are on Github in the package printf-tests. This is because they grew into an elaborate project of their own, and are intended to work with multiple and multilingual implementations of printf().
This implementation has been enhanced to allow most of the
formatting syntax of C printf(3)
.
Text.Printf.Extensible.printf
passes all of
the applicable tests that glibc
printf does: approximately
350 tests currently. Text.Printf.printf
, on the other
hand, currently fails about 150 of these tests.
This module is intended to be a 100% backward-compatible
superceding implementation of Text.Printf
. I hope that it
will eventually replace the current Text.Printf
in the GHC
libraries.
This work is reasonably well-documented in Haddock, and is
under a 3-clause BSD license as per Lennart Augustsson's
original implementation of Text.Printf
, from which most
of the code was taken, and much was heavily modified.