Skip to content

Releases: pointfreeco/swift-case-paths

0.5.0

13 Jul 16:12
5904cc7
Compare
Choose a tag to compare
  • Reflection code is now 100% powered by the runtime metadata and no longer relies on Mirror! Thanks @mayoff for diving even deeper into the problem, surfacing with a nice and succinct solution.

0.4.0

08 Jul 16:47
ac1cf1c
Compare
Choose a tag to compare
  • Reflection code has been further improved to use the Swift runtime for repeat successful extractions after the first successful one. This kind of extraction is about 25x faster than the previous release, and 50x faster than the release before it. Thanks, @mayoff!

0.3.0

05 Jul 13:58
e77b3a9
Compare
Choose a tag to compare
  • 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 to CustomStringConvertible.

0.2.0

15 Apr 15:14
Compare
Choose a tag to compare
  • 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 an if case statement.
    results.count(where: { /Result.success ~= $0 })
    
    // vs.
    results.count(where: { if case .success = $0 { return true } else { return false } })

0.1.3

28 Jan 17:06
1aa1bf7
Compare
Choose a tag to compare

Bug fixed: plugged a memory leak that occurred when destructuring a Mirror's children. #20 (thanks @rjantz2 and @pteasima)

0.1.2

29 Jul 16:07
ed1838a
Compare
Choose a tag to compare
  • Bug fixed: attempting to extract a case that takes an uninhabited enum (like Never) should no longer crash in Swift 5.3 (thanks @heiberg).

0.1.1

13 May 15:00
fb733d8
Compare
Choose a tag to compare
  • Added: an overload of / that takes .self to enable /.self syntax
  • Changed: the package name has changed from CasePaths to swift-case-paths (thanks @kaishin)
  • Infrastructure: formatting fix (thanks @mtfum)
  • Infrastructure: use swift-format

0.1.0

04 Feb 14:22
Compare
Choose a tag to compare

Case paths is a brand new library that brings the power and ergonomics of key paths to enums!