从F#类型提供程序提供有差别的联合

从F#类型提供程序提供有差别的联合,f#,type-providers,f#-3.0,F#,Type Providers,F# 3.0,我已经掌握了类型提供程序的基本知识,例如创建类型 let thisAssembly = Assembly.GetExecutingAssembly() let t = ProvidedTypeDefinition( thisAssembly,namespaceName, xType.Attribute(xname "name").Value, baseType = Some typeof<obj>) 让thisAss

我已经掌握了类型提供程序的基本知识,例如创建类型

let thisAssembly = Assembly.GetExecutingAssembly()
let t = ProvidedTypeDefinition(
           thisAssembly,namespaceName,
           xType.Attribute(xname "name").Value,
           baseType = Some typeof<obj>)
让thisAssembly=Assembly.getExecutionGassembly()
设t=ProvidedTypeDefinition(
此程序集,命名空间名称,
xType.Attribute(xname“name”).Value,
baseType=某种类型的

但是我需要能够定义记录类型和DU类型。有没有办法使用类型提供程序来做到这一点?

不幸的是,在类型提供程序中,仅定义类和名称空间,而不可能定义任何F#特定的类型,如有区别的联合、记录或模块,这有点不幸

这是CLR限制吗?我的意思是,函数式语言中的类非常有限。例如,记录将是SQL查询更自然的结果。