Both contain the basics of creating a ProvidedAssembly and adding the provided types to the ProvidedAssembly but it not clear on the correct order to avoid obscure compile failure messages.
e.g.
Do you only add the root provider to to the provided assembly
Do you just add the provided types generated in the DefineStaticParameters function
Do you do this before or after adding the root provider to the namespace
Does the order actually matter?
AddAssemblyTypesAsNestedTypesDelayed use cases
If you have another assembly which merely injects its types then you can use the AddAssemblyTypesAsNestedTypesDelayed which avoids encountering some of the above, but thats only useful if you are sending a command to an external code generator etc
When is SuppressRelocation useful?
When is ResetEnclosingType useful?
It would be good if there were canonical examples of the more common usages of generative providers, especially the areas I outlined above, as the documentation is really sparse.
Especially around the difference between generative and erasing providers.
Some question and notes dumped off the top of my head:
Generative providers
Here are some things I would like clarifying:
How to add types that are generated and have root providers with static parameters.
e.g
There are only a few reference on this creating-a-generative-type-provider the-trips-and-traps-of-creating-a-generative-type-provider-in-fsharp
Both contain the basics of creating a ProvidedAssembly and adding the provided types to the ProvidedAssembly but it not clear on the correct order to avoid obscure compile failure messages.
e.g.
AddAssemblyTypesAsNestedTypesDelayed use cases
If you have another assembly which merely injects its types then you can use the
AddAssemblyTypesAsNestedTypesDelayed
which avoids encountering some of the above, but thats only useful if you are sending a command to an external code generator etcWhen is
SuppressRelocation
useful?When is
ResetEnclosingType
useful?It would be good if there were canonical examples of the more common usages of generative providers, especially the areas I outlined above, as the documentation is really sparse.