Reputation: 6462
In A Peek into F# 4.1, the author demonstrated we could print to a string without sprintf
:
let private tryParseWith tryParseFunc (s : string) =
match (tryParseFunc s) with
| true, x -> Ok x
| false, _ -> Error ("%s is not capable of being parsed." s)
Can I not use sprintf
because the compiler is smart to infer StringFormat<string>
type and evaluate the expression to string
value in F# 4.1 and newer?
Upvotes: 1
Views: 277
Reputation: 691
String interpolation is currently not a feature that can be found in F# (as of version 4.1).
See https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1001-StringInterpolation.md for the current string interpolation proposal.
Upvotes: 3