mirror of
https://github.com/pointfreeco/swift-custom-dump.git
synced 2026-04-07 19:17:35 +00:00
17 lines
490 B
Swift
17 lines
490 B
Swift
public protocol DebugSnapshotRepresentable<DebugSnapshot> {
|
|
associatedtype DebugSnapshot
|
|
var _debugSnapshot: DebugSnapshot { get }
|
|
}
|
|
|
|
extension Optional: DebugSnapshotRepresentable where Wrapped: DebugSnapshotRepresentable {
|
|
public var _debugSnapshot: Wrapped.DebugSnapshot? {
|
|
self?._debugSnapshot
|
|
}
|
|
}
|
|
|
|
extension Array: DebugSnapshotRepresentable where Element: DebugSnapshotRepresentable {
|
|
public var _debugSnapshot: [Element.DebugSnapshot] {
|
|
map(\._debugSnapshot)
|
|
}
|
|
}
|