How is it possible for F # to check format strings at compile time to determine that x is of type int in the following definition?
let foo x = sprintf "%d" x`?
Is it hardcoded in the language, or can someone write their own function "my_print" that uses format strings with different syntax? For instance:
let foo x = my_print "{integer}" x
source share