-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some feature, add IdentifiedArray
Signed-off-by: MikePackard <[email protected]>
- Loading branch information
1 parent
1657fb3
commit 3c74377
Showing
78 changed files
with
3,374 additions
and
719 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.build | ||
DerivedData | ||
/.previous-build | ||
xcuserdata | ||
.DS_Store | ||
*~ | ||
\#* | ||
.\#* | ||
.*.sw[nop] | ||
*.xcscmblueprint | ||
/default.profraw | ||
*.xcodeproj | ||
Utilities/Docker/*.tar.gz | ||
.swiftpm | ||
Package.resolved | ||
/build | ||
*.pyc | ||
.docc-build | ||
.vscode | ||
Utilities/InstalledSwiftPMConfiguration/config.json |
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-26.5 KB
...ftpm/xcode/package.xcworkspace/xcuserdata/hien.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
Binary file removed
BIN
-22.4 KB
...m/xcode/package.xcworkspace/xcuserdata/phongnd.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
29 changes: 0 additions & 29 deletions
29
.swiftpm/xcode/xcuserdata/hien.xcuserdatad/xcschemes/xcschememanagement.plist
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
.swiftpm/xcode/xcuserdata/phongnd.xcuserdatad/xcschemes/xcschememanagement.plist
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,77 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "CwlCatchException", | ||
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "35f9e770f54ce62dd8526470f14c6e137cef3eea", | ||
"version": "2.1.1" | ||
} | ||
}, | ||
{ | ||
"package": "CwlPreconditionTesting", | ||
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "fb7a26374e8570ff5c68142e5c83406d6abae0d8", | ||
"version": "2.0.2" | ||
} | ||
}, | ||
{ | ||
"package": "Nimble", | ||
"repositoryURL": "https://github.com/Quick/Nimble.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "c93f16c25af5770f0d3e6af27c9634640946b068", | ||
"version": "9.2.1" | ||
} | ||
}, | ||
{ | ||
"package": "Quick", | ||
"repositoryURL": "https://github.com/Quick/Quick.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "bd86ca0141e3cfb333546de5a11ede63f0c4a0e6", | ||
"version": "4.0.0" | ||
} | ||
}, | ||
{ | ||
"package": "SwiftDocCPlugin", | ||
"repositoryURL": "https://github.com/apple/swift-docc-plugin", | ||
"state": { | ||
"branch": null, | ||
"revision": "9b1258905c21fc1b97bf03d1b4ca12c4ec4e5fda", | ||
"version": "1.2.0" | ||
} | ||
}, | ||
{ | ||
"package": "SymbolKit", | ||
"repositoryURL": "https://github.com/apple/swift-docc-symbolkit", | ||
"state": { | ||
"branch": null, | ||
"revision": "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version": "1.0.0" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
"pins" : [ | ||
{ | ||
"identity" : "cwlcatchexception", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mattgallagher/CwlCatchException.git", | ||
"state" : { | ||
"revision" : "3ef6999c73b6938cc0da422f2c912d0158abb0a0", | ||
"version" : "2.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "cwlpreconditiontesting", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", | ||
"state" : { | ||
"revision" : "2ef56b2caf25f55fa7eef8784c30d5a767550f54", | ||
"version" : "2.2.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "nimble", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Quick/Nimble.git", | ||
"state" : { | ||
"revision" : "c93f16c25af5770f0d3e6af27c9634640946b068", | ||
"version" : "9.2.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "quick", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Quick/Quick.git", | ||
"state" : { | ||
"revision" : "bd86ca0141e3cfb333546de5a11ede63f0c4a0e6", | ||
"version" : "4.0.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-collections", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-collections", | ||
"state" : { | ||
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", | ||
"version" : "1.1.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-docc-plugin", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-docc-plugin", | ||
"state" : { | ||
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", | ||
"version" : "1.3.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-docc-symbolkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-docc-symbolkit", | ||
"state" : { | ||
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", | ||
"version" : "1.0.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-identified-collections", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/pointfreeco/swift-identified-collections", | ||
"state" : { | ||
"revision" : "d1e45f3e1eee2c9193f5369fa9d70a6ddad635e8", | ||
"version" : "1.0.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import Foundation | ||
|
||
/// A type erased `AsyncSequence` | ||
/// | ||
/// This type allows you to create APIs that return an `AsyncSequence` that allows consumers to iterate over the sequence, without exposing the sequence's underlyin type. | ||
/// Typically, you wouldn't actually initialize this type yourself, but instead create one using the `.eraseToAnyAsyncSequence()` operator also provided with this package. | ||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) | ||
public struct AnyAsyncSequence<Element>: AsyncSequence { | ||
|
||
// MARK: - Initializers | ||
|
||
/// Create an `AnyAsyncSequence` from an `AsyncSequence` conforming type | ||
/// - Parameter sequence: The `AnySequence` type you wish to erase | ||
public init<T: AsyncSequence>(_ sequence: T) where T.Element == Element { | ||
makeAsyncIteratorClosure = { AnyAsyncIterator(sequence.makeAsyncIterator()) } | ||
} | ||
|
||
public struct AnyAsyncIterator: AsyncIteratorProtocol { | ||
private let nextClosure: () async throws -> Element? | ||
|
||
public init<T: AsyncIteratorProtocol>(_ iterator: T) where T.Element == Element { | ||
var iterator = iterator | ||
nextClosure = { try await iterator.next() } | ||
} | ||
|
||
public func next() async throws -> Element? { | ||
try await nextClosure() | ||
} | ||
} | ||
|
||
// MARK: - AsyncSequence | ||
|
||
public typealias Element = Element | ||
|
||
public typealias AsyncIterator = AnyAsyncIterator | ||
|
||
public func makeAsyncIterator() -> AsyncIterator { | ||
AnyAsyncIterator(makeAsyncIteratorClosure()) | ||
} | ||
|
||
private let makeAsyncIteratorClosure: () -> AsyncIterator | ||
|
||
} | ||
|
||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) | ||
public extension AsyncSequence { | ||
|
||
/// Create a type erased version of this sequence | ||
/// - Returns: The sequence, wrapped in an `AnyAsyncSequence` | ||
func eraseToAnyAsyncSequence() -> AnyAsyncSequence<Element> { | ||
AnyAsyncSequence(self) | ||
} | ||
} |
Oops, something went wrong.