You can check format strings in Java at compile-time using the Checker Framework: <a href="http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#formatter-checker" rel="nofollow">http://types.cs.washington.edu/checker-framework/current/che...</a><p>The format string semantics are actually pretty tricky because printf will perform conversions in certain cases.
Very cool, Idris looks like a really interesting language.<p>F#'s standard printf-family functions are all type-safe in exactly the same way. This requires special support by the compiler, though, as F#'s type system is not as powerful. Most of the plumbing is standard, but the conversion from string literal to PrintfFormat at compile time is only possible due to hardcoded magic. You can't get exactly the same effect from plain user code, though you could certainly get something very close using a Type Provider (the syntax would just be a bit clunkier).
Why define Format as<p><pre><code> data Format = FInt Format
| FString Format
| FOther Char Format
| FEnd
</code></pre>
instead of using lists?<p><pre><code> data FormatPart = FInt | FString | FOther Char
type Format = List FormatPart</code></pre>