Releases: pointfreeco/swift-case-paths
Releases · pointfreeco/swift-case-paths
0.10.0
What's Changed
- Added:
CasePath
now conforms toSendable
(#90). Locking has been added aroundembed
/extract
functions, which should help avoid some data races without much overhead. If you notice any issues with the upgrade, please let us know! - Added:
CasePath.some
, for unwrapping optionals via.some
or/.some
instead of/Optional.some
(#91).
Full Changelog: 0.9.2...0.10.0
0.9.2
Fixed: The swift-case-paths package no longer publicly vends its internal schemes.
0.9.1
- Fixed: The
CasePath.init
overloads introduced in 0.9.0 now support the same implicit optional promotion behavior of/
.
0.9.0
- Added:
CasePath.init(Enum.case)
alternative to/Enum.case
. Xcode 14 beta 1 puts projects using Case Paths in a very broken state right now. This initializer is a workaround that can be used, instead, to avoid breaking things like syntax highlighting and file-wide indentation. - Fixed: case path composition operator associativity should now behave as expected (thanks @nonameplum).
0.8.1
- Bug fix: A Linux bug that could prevent multiple associated values from being extracted has been fixed.
0.8.0
- Changed:
CasePath.modify
now returns the value returned by its closure. - Fixed: runtime extraction of an
Error
existential should no longer crash (thanks @mayoff). - Fixed: runtime extraction of an object-bound protocol existential should no longer crash (thanks @iampatbrown).
- Infrastructure: corrected README typos (thanks @ferologics) and example code, fixed CI and auto-format.
0.7.0
-
Added:
CasePath.modify
, which allows you to mutate the associated value of an enum in-line:try (/Result<Int, Error>.success).modify(&result) { $0 *= 2 }
0.6.2
- Bug fixed: a regression in which case path expressions to enum cases with no associated values, where the
Root
is optional-promoted by the compiler, extraction wasn't working correctly.
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.