Search code examples
f#type-providers

About F# TypeProvider Static Parameter Syntax


  1. Why TypeProvider supports static parameters, how is this done, and does the f# compiler specifically support this feature?
  2. I write a class myself, do not implement the ITypeProvider interface, can do the same effect?

  3. The syntax of static parameters is not described in the f# language reference, is there any relevant help?

Thank you very much!


Solution

  • I think you are asking if the static parameters mechanism used in type providers can be used in ordinary F# code.

    The short answer is no.

    Type providers are special: they are compiler plug-ins that provides types, properties, and methods for use in your code. Special rules apply to them.