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.
Module documentation is published on Pursuit: http://pursuit.purescript.org/packages/purescript-formatting
This package is a port of Chris Done's Formatting library for Haskell.
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.
A port of this library is also available for Elm.
Copyright © 2017 Kris Jenkins
Distributed under the MIT license.