xformat: Extensible, type-safe formatting with scanf- and printf-like functions
This package is composed of two functions for formatted conversion between strings and typed values. Each is defined as a type-indexed function using a type class with multiple parameters and functional dependencies along with format descriptors.
Text.XFormat.Read allows one to parse values from a formatted string. Its
functionality is similar to the C scanf
function. Unlike scanf
, however,
the format descriptor is well-typed, ensuring that the output type is
statically known.
Text.XFormat.Show allows one to print values to a formatted string. Its
functionality is similar to the C printf
function. Unlike printf
, however,
the format descriptor is well-typed, ensuring that the variable number
arguments are statically known.
These functions can be easily extended to support new formats and new types. Extension is simple: define a format descriptor and an instance of the appropriate class.
Downloads
- xformat-0.1.2.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1, 0.1.1, 0.1.2, 0.1.2.1 |
---|---|
Dependencies | base (>=3.0 && <5.0) [details] |
Tested with | ghc ==6.8.3, ghc ==6.10.1, ghc ==7.4.1, ghc ==7.6.3 |
License | BSD-3-Clause |
Copyright | (c) 2009-2014 Sean Leather |
Author | Sean Leather |
Maintainer | sean.leather@gmail.com |
Category | Text, Generics |
Home page | http://github.com/spl/xformat |
Source repo | head: git clone git@github.com:spl/xformat.git |
Uploaded | by SeanLeather at 2013-12-31T19:40:04Z |
Distributions | |
Reverse Dependencies | 3 direct, 3 indirect [details] |
Downloads | 4747 total (5 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Successful builds reported [all 1 reports] |