Releases: pointfreeco/swift-case-paths
Releases · pointfreeco/swift-case-paths
0.6.1
0.6.0
- Fixed regression: Swift can optional-promote the
Root
of an embed function(Value) -> Root
to(Value) -> Root?
and yieldCasePath<Root?, Value>
instead of `CasePath<Root, Value>. Extraction was still handled successfully in 0.3.0 and earlier, but broke in 0.4.0. Thanks @mayoff for the fix! - Fixed regression: Swift can optional-demote the
Value
of an embed function(Value?) -> Root
to(Value) -> Root
and yieldCasePath<Root, Value>
instead of `CasePath<Root, Value?>. Extraction was still handled successfully in 0.3.0 and earlier, but broke in 0.4.0. Thanks @mayoff for this fix as well! - A family of helpers functions around reflection/runtime extraction has been deprecated, this includes module-level
extract
functions andCasePath.case
. The library now always favors using case path syntax (/Root.caseName
) or theCasePath.extract(from:)
method.
0.5.0
0.4.0
0.3.0
- Reflection code has been rewritten for improved performance and simplicity. Successful extractions perform a little over 2× faster than previously. Failed extractions, at worst, perform 2× faster, and at best, perform in under 100ns (best case assumes the case path has made a successful extraction at some point of the application's lifetime). Note: some of these changes are breaking (see #32 for more details and upgrade paths), but should not affect most users of the library.
CasePath
now conforms toCustomStringConvertible
.
0.2.0
- Added:
CasePath
now supports the pattern-matching operator (~=
) which can be useful in expressing whether a value matches a particular case without having to open anif case
statement.results.count(where: { /Result.success ~= $0 }) // vs. results.count(where: { if case .success = $0 { return true } else { return false } })
0.1.3
0.1.2
0.1.1
0.1.0
Case paths is a brand new library that brings the power and ergonomics of key paths to enums!