Search code examples
f#type-providers

Is it possible to use arrays as static parameters in F# type providers?


I want to create a type provider with a static parameter that is an array. I thought this might work if the array was of another primitive type (int, string etc), but this seems not to work.

As a motivating use-case, this would, for example, allow specifying header names when using a CSV type provider for .csv files without a header row.


Solution

  • Only primitive types can be used as type provider parameters. The current json type provider gets around that by using a comma separated list of parameters as a string.