RecordGenerator icon indicating copy to clipboard operation
RecordGenerator copied to clipboard

💡 Struct builder supporting inheritance

Open amis92 opened this issue 4 years ago • 1 comments

HaloFour wrote up an interesting solution for struct Builder that also supports inheritance and allows nice selective With update.

See https://gist.github.com/amis92/dfc52fb774d44194f8846b2f560c2f96

This would solve our following issues:

  • A different kind of Wither: With(Optional...) #102
  • PartialBuilder with Option properties as a "delta" #46
  • Support positional/ordered and nominal/unordered data objects/records #43 struct Builder would nicely support unordered feature
  • Enhance internal Builder workings #41
  • partially Support for record hierarchies #12

@bboyle1234 @atifaziz @mkmz request for comments :)

This could be a new "kind" of Record, mostly because it has a very different API. Maybe [NominalRecord] pointing to the fact it's nominal as in non-ordered/name-bound? Other ideas?

amis92 avatar Mar 18 '20 10:03 amis92

Gist taken from https://github.com/dotnet/csharplang/issues/3174#issuecomment-584900188

amis92 avatar Mar 18 '20 10:03 amis92