Unfortunately, it's not possible to define any F# specific types like Discriminated Unions, Records, or Modules, in a type provider, only classes and namespaces, which is a bit unfortunate
Providing a Discriminated Union from an F# Type Provider
-
29-08-2022 - |
Question
I've gotten the basics of type providers such as creating a type
let thisAssembly = Assembly.GetExecutingAssembly()
let t = ProvidedTypeDefinition(
thisAssembly,namespaceName,
xType.Attribute(xname "name").Value,
baseType = Some typeof<obj>)
but I need to be able to define record types and DU types is there any way to do this with type providers?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow