I'm looking for a way, in F#, to print a value together with source file and line number; it's intended for semi-interactive debugging, so the syntax needs to be short.
https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/caller-information provides a partial solution. The code on that page can be called like:
Tracer().DoTrace "foo"
and I'm looking for
trace "foo"
But of course, wrapping the above in a trace function will report trace being always the caller, which defeats the purpose.
I tried let inline trace ... but that didn't make any difference.
I would try using a macro if F# had such, but it doesn't.
What's the best way, by modifying the above linked code or otherwise, to obtain trace functionality with the shortest possible caller syntax?