How does Haskell printf work?

Haskell's type safety is second to none only to dependently-typed languages. But there is some deep magic going on with Text.Printf that seems rather type-wonky. > printf "%d\n" 3 3 > printf...