The xformat package
Warning: This version of the package is very experimental and the interface may change in later versions. I am seeking comments to improve it.
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.
Properties
| Versions | 0.1, 0.1.1 |
|---|---|
| Dependencies | base (≥3.0 & <5.0) |
| License | BSD3 |
| Copyright | (c) 2009 Sean Leather |
| Author | Sean Leather |
| Maintainer | leather@cs.uu.nl |
| Stability | experimental |
| Category | Text, Generics |
| Home page | http://github.com/spl/xformat |
| Upload date | Thu Mar 1 21:27:24 UTC 2012 |
| Uploaded by | SeanLeather |
| Built on | ghc-7.4 |
Modules
- Text
Downloads
- xformat-0.1.1.tar.gz (Cabal source package)
- package description (included in the package)