F# is how I learned about type providers:
http://fsprojects.github.io/FSharp.Data/library/CsvProvider....
But look at that syntax:
CsvProvider<"file.csv">.Load("file.csv")
The file name is listed twice! Conceivably a macro could hide that, but we'd still have the issue that the string has to be written fully. I.e., I can't just call a function to generate the string.F# has Literals that mitigate some of this, but my understanding is that they are pretty limited:
https://github.com/fsharp/fslang-suggestions/issues/539
On the other hand, Empirical can perform automatic compile-time function evaluation on any legal expression, including across variables, user-defined functions, user-defined datatypes, etc.
func filename(n):
let value = String(n + 1)
return "/path/to/" + value + ".csv"
end
load(filename(7))
I could put the filename in a Dataframe embedded in my source, then reference the row/column I want. Empirical's automatic CTFE handles it.