symbols-0.1.0.0: Symbol manipulation

Safe HaskellSafe
LanguageHaskell2010

Data.Symbol.Examples.Printf

Documentation

data Specifier Source #

Constructors

D 
S 
Lit Symbol 
Instances
FormatF ([] :: [Specifier]) String Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

(FormatF rest fun, KnownSymbol l) => FormatF (Lit l ': rest) fun Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

Methods

formatF :: String -> fun Source #

FormatF rest fun => FormatF (D ': rest) (Int -> fun) Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

Methods

formatF :: String -> Int -> fun Source #

FormatF rest fun => FormatF (S ': rest) (String -> fun) Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

Methods

formatF :: String -> String -> fun Source #

class FormatF (format :: [Specifier]) fun | format -> fun where Source #

Methods

formatF :: String -> fun Source #

Instances
FormatF ([] :: [Specifier]) String Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

(FormatF rest fun, KnownSymbol l) => FormatF (Lit l ': rest) fun Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

Methods

formatF :: String -> fun Source #

FormatF rest fun => FormatF (D ': rest) (Int -> fun) Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

Methods

formatF :: String -> Int -> fun Source #

FormatF rest fun => FormatF (S ': rest) (String -> fun) Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

Methods

formatF :: String -> String -> fun Source #

class PrintF (sym :: Symbol) fun where Source #

Methods

printf :: fun Source #

Instances
(Listify sym lst, fmt ~ Parse lst, FormatF fmt fun) => PrintF sym fun Source # 
Instance details

Defined in Data.Symbol.Examples.Printf

Methods

printf :: fun Source #

type family Parse (lst :: [Symbol]) :: [Specifier] where ... Source #

Equations

Parse '[] = '[Lit ""] 
Parse ("%" ': ("d" ': xs)) = D ': Parse xs 
Parse ("%" ': ("s" ': xs)) = S ': Parse xs 
Parse (x ': xs) = Parse2 x (Parse xs) 

type family Parse2 (c :: Symbol) (lst :: [Specifier]) :: [Specifier] where ... Source #

Equations

Parse2 c (Lit s ': ss) = Lit (AppendSymbol c s) ': ss 
Parse2 c ss = Lit c ': ss