xformat

Extensible, type-safe formatting with scanf- and printf-like functions

http://github.com/spl/xformat

LTS Haskell 6.35:0.1.2.1
Stackage Nightly 2016-05-25:0.1.2.1
Latest on Hackage:0.1.2.1

See all snapshots xformat appears in

BSD-3-Clause licensed by Sean Leather
Maintained by [email protected]
This version can be pinned in stack with:xformat-0.1.2.1@sha256:364a8698f41f69fc171595b8a429ad8929ce857cafa1533d5092c046706e3361,2213

Module documentation for 0.1.2.1

Depends on 1 package(full list with versions):
Used by 1 package in lts-6.19(full list with versions):

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.