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

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Printf.Safe.Core

Synopsis

Documentation

type family as ~> b Source

Variadic function types.

Equations

[] ~> a = a 
(x : xs) ~> a = x -> xs ~> a 

type Formatter a = a -> String Source

Formatter type.

data Printf xs where Source

Printf Format.

Constructors

EOS :: Printf [] 
(:<>) :: String -> Printf xs -> Printf xs infixr 9 
(:%) :: Formatter x -> Printf xs -> Printf (x : xs) infixr 9 

Instances

(~) [*] xs ([] *) => IsString (Printf xs) 

data HList ts where Source

Hetero list.

Constructors

HNil :: HList [] 
(:-) :: a -> HList xs -> HList (a : xs) infixr 9 

printf :: Printf xs -> xs ~> String Source

Variadic version.

printf' :: Printf ts -> HList ts -> String Source

HList version.