Skip to content

Releases: pointfreeco/swift-case-paths

0.10.0

13 Oct 21:51
15bba50
Compare
Choose a tag to compare

What's Changed

  • Added: CasePath now conforms to Sendable (#90). Locking has been added around embed/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

12 Sep 14:37
7346701
Compare
Choose a tag to compare

Fixed: The swift-case-paths package no longer publicly vends its internal schemes.

0.9.1

13 Jul 14:31
a098393
Compare
Choose a tag to compare
  • Fixed: The CasePath.init overloads introduced in 0.9.0 now support the same implicit optional promotion behavior of /.

0.9.0

10 Jun 18:27
b4a8729
Compare
Choose a tag to compare
  • 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

22 Apr 16:15
ce9c0d8
Compare
Choose a tag to compare
  • Bug fix: A Linux bug that could prevent multiple associated values from being extracted has been fixed.

0.8.0

02 Jan 16:46
241301b
Compare
Choose a tag to compare
  • 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

29 Jul 16:27
d226d16
Compare
Choose a tag to compare
  • 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

24 Jul 15:22
40072a9
Compare
Choose a tag to compare
  • 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

23 Jul 13:31
45da9b8
Compare
Choose a tag to compare
  • Bug fixed: failed extractions via the optional demotion handled in 0.6.0 would infinitely recurse.

0.6.0

22 Jul 14:54
Compare
Choose a tag to compare
  • Fixed regression: Swift can optional-promote the Root of an embed function (Value) -> Root to (Value) -> Root? and yield CasePath<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 yield CasePath<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 and CasePath.case. The library now always favors using case path syntax (/Root.caseName) or the CasePath.extract(from:) method.