safe-printf-0.1.0.0: Well-typed, flexible and variadic printf for Haskell

Safe HaskellNone
LanguageHaskell2010

Text.Printf.Safe.Combinators

Contents

Synopsis

Smart constructors

type family xs <> ys Source

Equations

[] <> xs = xs 
(x : xs) <> ys = x : (xs <> ys) 

(><) :: Printf ts -> String -> Printf ts infixl 5 Source

Append plain string to format.

(%) :: Printf ts -> (a -> String) -> Printf (ts <> `[a]`) infixl 5 Source

Append formatter to format.

(+++) :: Printf ts -> Printf ps -> Printf (ts <> ps) infixr 5 Source

Concatenate two prtinf formats.

Basic formatters

s :: Formatter String Source

Format String as it is.

_S :: Show a => Formatter a Source

Formatter for Show instances.

_shows :: (a -> ShowS) -> Formatter a Source

Converts ShowS function to Formatter.

Number Formatters

base Source

Arguments

:: (Show a, Integral a) 
=> a

Base

-> Maybe (Char, Int)

Padding settings.

-> Formatter a 

Format Integrals at base.

d :: (Show a, Integral a) => Formatter a Source

No padding version of d'.

d' :: (Show a, Integral a) => Char -> Int -> Formatter a Source

Decimal formatter with padding.

o :: (Show a, Integral a) => Formatter a Source

No padding version of o'.

o' :: (Show a, Integral a) => Char -> Int -> Formatter a Source

Octal formatter with padding.

b :: (Show a, Integral a) => Formatter a Source

No padding version of b'.

b' :: (Show a, Integral a) => Char -> Int -> Formatter a Source

Binary formatter with padding.

h :: (Show a, Integral a) => Formatter a Source

No padding version of b'.

h' :: (Show a, Integral a) => Char -> Int -> Formatter a Source

Binary formatter with padding.

f :: RealFloat a => Formatter a Source

RealFloat formatter.