Source Generation
FxKit ships with a few (optional) source generators, each enabled by their respective attribute:
[EnumMatch]: generates aMatchextension method for the enum type. Useful to guarantee exhaustive matching. Each enum member will be represented as a function parameter toMatch.[Lambda]: when used at the type level, generates aλas aFunc, allowing you to pass a type's constructor as a function. When used on a method, generates aFuncfor that method suffixed withλin the name.[Union]: turns the record into a union type. Each member gets aλandOfmethods for constructing the member. The return type of these is the base type which makes it useful for mapping.[GenerateTransformer]: when used on extension methods that operate on functor types.
To use, install the FxKit.CompilerServices and FxKit.CompilerServices.Annotations packages.