A type-safe string formatting library, based on Chris Done's Haskell version.

It fulfils the need for string-interpolation or a printf function, without sacrificing type safety or requiring any special language-level support.

It also composes well, making it easy to build up complex, reusable formatters.

Documentation

Module documentation is published on Pursuit: http://pursuit.purescript.org/packages/purescript-formatting

Credits

This package is a port of Chris Done's Formatting library for Haskell.

Contributing

More specialised formatters (like "print to a certain number of decimal places") would be welcome.

For more advanced help, I have a suspicion that before and after have a proper home in some category somewhere, and I'd like to find out where it is. Also, I suspect we can relax the composition restraint from Format String to forall m. Semigroupoid m => Format m . If you know how, I'd love your input.

See Also

A port of this library is also available for Elm.

License

Copyright © 2017 Kris Jenkins

Distributed under the MIT license.