Skip to content
Draft
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'
12 changes: 1 addition & 11 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"]
),
.library(
name: "CasePathsMacrosSupport",
targets: ["CasePathsMacrosSupport"]
Expand All @@ -34,14 +30,8 @@ let package = Package(
.target(
name: "CasePaths",
dependencies: [
"CasePathsCore",
"CasePathsMacros",
]
),
.target(
name: "CasePathsCore",
dependencies: [
.product(name: "IssueReporting", package: "swift-issue-reporting")
.product(name: "IssueReporting", package: "swift-issue-reporting"),
]
),
.target(
Expand Down
12 changes: 1 addition & 11 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/pointfreeco/xctest-dynamic-overlay", from: "1.13.0"),
Expand All @@ -30,14 +26,8 @@ let package = Package(
.target(
name: "CasePaths",
dependencies: [
"CasePathsCore",
"CasePathsMacros",
]
),
.target(
name: "CasePathsCore",
dependencies: [
.product(name: "IssueReporting", package: "xctest-dynamic-overlay")
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
]
),
.macro(
Expand Down
12 changes: 1 addition & 11 deletions Package@swift-6.0.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"]
),
.library(
name: "CasePathsMacrosSupport",
targets: ["CasePathsMacrosSupport"]
Expand All @@ -34,14 +30,8 @@ let package = Package(
.target(
name: "CasePaths",
dependencies: [
"CasePathsCore",
"CasePathsMacros",
]
),
.target(
name: "CasePathsCore",
dependencies: [
.product(name: "IssueReporting", package: "xctest-dynamic-overlay")
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
]
),
.target(
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,15 @@ extension Authentication.AllCasePaths {
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
@@ -1,5 +1,3 @@
import Foundation

/// A type-erased case path that supports embedding a value in a root and attempting to extract a
/// root's embedded value.
///
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,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 @@ -150,7 +150,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 @@ -342,7 +342,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 @@ -375,7 +375,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 Expand Up @@ -544,7 +544,7 @@ extension CasePathable {
}

extension AnyCasePath {
/// Creates a type-erased case path for given case key path.
/// Creates a type-erased case path for a given case key path.
///
/// - Parameter keyPath: A case key path.
public init(_ keyPath: CaseKeyPath<Root, Value>) {
Expand Down
6 changes: 0 additions & 6 deletions Sources/CasePaths/Documentation.docc/CasePathableMacro.md

This file was deleted.

Loading