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
041f94dcd6f7e66679da2ead9c76e5aaa24f0d17ec559ab354806133340f877095226f2d4bc36a07c4cf1f1e9269bb3bb55970234a0af292c869446ce0f6e8e886;nsirlconnection |
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
extension Optional: Collection where Wrapped: Collection { | |
public typealias Element = Wrapped.Element | |
public typealias Index = Wrapped.Index | |
public func index(after i: Wrapped.Index) -> Wrapped.Index { | |
switch self { | |
case let value?: | |
return value.index(after: i) | |
case nil: | |
fatalError() // TODO: ??? |
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
public struct OptionalIndex<InnerIndex: Comparable> { | |
let inner: InnerIndex? | |
init(_ base: InnerIndex) { | |
inner = base | |
} | |
init() { | |
inner = nil | |
} |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
extension Binding { | |
/// like Binding.constant but lets you update the value and stores that updated value via a captured enclosing reference. | |
public static func initially(_ value: Value) -> Binding<Value> { | |
let box = Box(value) | |
return .init( | |
get: { box.value }, | |
set: { box.value = $0 } | |
) | |
} |
OlderNewer