-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A Perl printf like formatter. -- -- A Perl printf like formatter. @package printf-mauke @version 0.5.1 module Text.Printf.Mauke.TH -- | A static checking layer on top of Text.Printf.Mauke.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 Text.Printf.Mauke.printf "%d %d" x y. printf :: String -> ExpQ instance Eq PType instance Ord PType instance Show PType instance Read PType instance ToString ByteString instance ToString ByteString instance ToChar a => ToString [a] module Text.Printf.Mauke -- | Format a variable number of arguments according to a format string, -- similar to (s)printf in Perl. The return value is either a -- String or IO a, in which case the result is -- printed to stdout. If you use the IO variant, don't use -- the result: Because it has to be of any type a, this library -- makes it undefined. -- -- The format string consists of ordinary characters (everything except -- '%'), which are passed through unchanged, and formatting -- directives, which have the following form: -- --
--   % flag* vector? width? precision? type
--   
-- -- (* and ? mean 0 or more and 0 or 1 of the preceding -- item, respectively.) -- -- Flags: -- -- -- -- The vector flag v tells printf to format each -- character in the string argument according to the current directive, -- then joins the results with a separator that defaults to ".". -- When *v is used, the separator is taken from the argument -- list (use e.g. printf "%*v.2x" "" str if you want no -- separator). -- -- The width is either a decimal integer or *, in which -- case the width is taken from the argument list (this argument must be -- an integer). It specifies the minimum width for this field. Shorter -- values are padded on the left with spaces (but this can be changed by -- the 0 and - flags). If the width taken from -- the argument list is negative, it behaves as if the - flag -- was specified. -- -- The precision consists of a . followed by digits or a -- * (see the description of width above). The effects -- depend on the format type: -- -- -- -- Types: -- -- printf :: PrintfType r => String -> r -- | Like printf, except that the result is printed to the specified -- Handle. hPrintf :: HPrintfType r => Handle -> String -> r -- | Class for valid printf arguments. class PrintfArg a embed :: PrintfArg a => a -> Arg -- | The internal type used to wrap and store all arguments. data Arg AInt :: Integer -> Arg AChar :: Char -> Arg AStr :: String -> Arg AFloat :: Double -> Arg class FromChar a fromChar :: FromChar a => Char -> a class ToChar a toChar :: ToChar a => a -> Char class PrintfType a class HPrintfType a instance HPrintfType (IO a) instance (PrintfArg a, HPrintfType r) => HPrintfType (a -> r) instance PrintfType (IO a) instance (PrintfArg a, PrintfType r) => PrintfType (a -> r) instance FromChar a => PrintfType [a] instance FromChar Char