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

Safe HaskellNone
LanguageHaskell98

Text.Printf.Mauke.TH

Synopsis

Documentation

printf :: String -> ExpQ Source

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 -> ExpQ Source

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