Adam Gashlin (3) [Avatar] Offline
I'm trying to understand the purpose of
toFormat ('%' :: chars) = Lit "%" (toFormat chars)
in listing 6.8. It looks like it will cause literals to be split whenever a % that is not %s or %d is encountered, which seems undesirable.

I thought it might be an implementation of an escape sequence so that it would be possible to print "%s" with printf "%%s", but that would look more like
toFormat ('%' :: '%' :: chars) = Lit "%" (toFormat chars)

Am I missing something?