
4 Dec
2020
4 Dec
'20
3:08 p.m.
On Fri, 4 Dec 2020, Ben Franksen wrote:
Wow, that simple. Thanks Henning, my untangled brain feels a lot better :-)
I tangled my brain because I expected that it must be possible in Haskell 98 ... ... and actually it is: import Text.Printf (PrintfType, printf) type Value = Int printfv :: (PrintfType printf) => String -> [Value] -> printf printfv fmt [] = printf fmt printfv fmt (x:xs) = printfv fmt xs x format :: String -> [Value] -> String format fmt = printfv fmt . reverse