printf-mauke-0.6.0: A Perl printf like formatter.

Safe HaskellNone




printf :: String -> ExpQSource

A static checking layer on top of printf. It hasn't been tested much, but static argument checking is always a good idea. To use it, add

 {-# LANGUAGE TemplateHaskell #-}

 import Text.Printf.Mauke.TH

at the top of your code and call $(printf "%d %d") x y instead of printf "%d %d" x y.

Starting with version 0.6.0 of this library, printf 's return type is overloaded: Like the non-TH printf it can return either a String or IO a. (It used to return String unconditionally.)

sprintf :: String -> ExpQSource

Works like printf but always returns a String. In versions before 0.6.0 of this library, this function was called printf.