This is the first step into the world of Structured Concurrency & Typed-Throws for FunctionTools. This new major version starts small:
Function types
Added AsyncGenerator and AsyncThrowingGenerator, defining the type of functions which generate values (and possibly errors), possibly in another concurrency context.
Explicitly-typed throws on all throwing function types.
Updated blackhole
blackhole has been updated to be @Sendable and take a parameter pack.
Updated null
Same story as blackhole.
Updated call
Added a series of call overloads which take generators and return the generated value, and added the new AsyncGenerator and AsyncThrowingGenerator as well.
Of course, throwing call overloads are typed as well.
Updated echo
Added a new echo overload which returns an AsyncGenerator, and marked it (and the one which returns a Generator as disfavored overloads.
Test naming
Test file naming now uses `tick marks` to make it obvious the file is testing a function rather than a type. Source files might be updated this way in a future release.
New license
This replaces the old confusing license model (branching license where PKWare get the MIT license and everyone else got a custom license which tried to be like CC-BY-SA) with a single simple license, The Fair License. This is more permissive, so it's not considered a breaking change.
Breaking changes
- Bumped Swift compiler requirement from
5.2to6.0 - Throwing function types now require a type for the thrown error
- Renamed one of the former
echofunctions to be acallfunction
Patch changes
2.0.1- #23 Converted
blackholeandnullfunctions to use parameter packs, instead of having a bunch of overloads for different parameter counts
- #23 Converted