Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: 1
builder:
configs:
- documentation_targets: [CasePathsCore, CasePaths]
- documentation_targets:
- CasePaths
custom_documentation_parameters:
- '--enable-experimental-overloaded-symbol-presentation'
10 changes: 0 additions & 10 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ let package = Package(
name: "CasePaths",
targets: ["CasePaths"]
),
.library(
name: "CasePathsCore",
targets: ["CasePathsCore"]
),
],
dependencies: [
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"603.0.0"),
Expand All @@ -30,13 +26,7 @@ let package = Package(
.target(
name: "CasePaths",
dependencies: [
"CasePathsCore",
"CasePathsMacros",
]
),
.target(
name: "CasePathsCore",
dependencies: [
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
]
),
Expand Down
10 changes: 0 additions & 10 deletions Package@swift-5.9.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ let package = Package(
name: "CasePaths",
targets: ["CasePaths"]
),
.library(
name: "CasePathsCore",
targets: ["CasePathsCore"]
),
],
dependencies: [
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"603.0.0"),
Expand All @@ -30,13 +26,7 @@ let package = Package(
.target(
name: "CasePaths",
dependencies: [
"CasePathsCore",
"CasePathsMacros",
]
),
.target(
name: "CasePathsCore",
dependencies: [
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
]
),
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ struct ItemStatusView: View {

> **Note**
> The above is a simplified version of the subscript that ships in our
> [SwiftUINavigation](https://github.com/pointfreeco/swiftui-navigation) library.
> [Swift Navigation](https://github.com/pointfreeco/swift-navigation) library.

#### Computed paths

Expand Down Expand Up @@ -397,15 +397,19 @@ extension Authentication.AllCasePaths {

## Case studies

* [**SwiftUINavigation**](https://github.com/pointfreeco/swiftui-navigation) uses case paths to
power SwiftUI bindings, including navigation, with enums.

* [**The Composable Architecture**](https://github.com/pointfreeco/swift-composable-architecture)
allows you to break large features down into smaller ones that can be glued together user key
paths and case paths.

* [**Parsing**](https://github.com/pointfreeco/swift-parsing) uses case paths to turn unstructured
data into enums and back again.
* [**SwiftNavigation**](https://github.com/pointfreeco/swift-navigation) adds support for enum
bindings to SwiftUI (as well as UIKit and even AppKit), which can drive controls as well as
navigation.

* [**SQLiteData**](https://github.com/pointfreeco/sqlite-data) models "single table inheritance"
using enums.

* [**Parsing**](https://github.com/pointfreeco/swift-parsing) turns unstructured data into enums
and back again.

Do you have a project that uses case paths that you'd like to share? Please
[open a PR](https://github.com/pointfreeco/swift-case-paths/edit/main/README.md) with a link to it!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extension Case: _AnyCase {
/// `\.someCase` where the type can be inferred.
///
/// To extract an associated value from an enum using a case key path, pass the key path to the
/// ``CasePathable/subscript(case:)-3yqx3``. For example:
/// ``CasePathable/subscript(case:)->Value?``. For example:
///
/// ```swift
/// @CasePathable
Expand All @@ -123,7 +123,7 @@ extension Case: _AnyCase {
/// // anotherValue is nil
/// ```
///
/// To replace an associated value, assign it through ``CasePathable/subscript(case:)-2t4f8``. If
/// To replace an associated value, assign it through ``CasePathable/subscript(case:)->Value``. If
/// the given path does not match the given enum case, the replacement will fail. For
/// example:
///
Expand Down Expand Up @@ -315,7 +315,7 @@ extension CasePathable {
/// e[case: \.anotherCase] // nil
/// ```
///
/// See ``CasePathable/subscript(case:)-2t4f8`` for replacing an associated value in a root
/// See ``CasePathable/subscript(case:)->Value`` for replacing an associated value in a root
/// enum, and see ``Swift/KeyPath/callAsFunction(_:)`` for embedding an associated value in a
/// brand new root enum.
public subscript<Value>(case keyPath: CaseKeyPath<Self, Value>) -> Value? {
Expand Down Expand Up @@ -348,7 +348,7 @@ extension CasePathable {
/// // e is still SomeEnum.someCase(24)
/// ```
///
/// See ``CasePathable/subscript(case:)-3yqx3`` for extracting an associated value from a root
/// See ``CasePathable/subscript(case:)->Value?`` for extracting an associated value from a root
/// enum, and see ``Swift/KeyPath/callAsFunction(_:)`` for embedding an associated value in a
/// brand new root enum.
@_disfavoredOverload
Expand Down
6 changes: 0 additions & 6 deletions Sources/CasePaths/Documentation.docc/CasePathableMacro.md

This file was deleted.

Loading