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
import Foundation | |
///A Result type which indicates the success or failure of a task. Has a generic Value, and uses a Swift.Error for the failure case. Specialization of SpecificResult. | |
public typealias Result<T> = SpecificResult<T,Swift.Error> | |
///A Result type which indicates the success or failure of a task using an enum to hold the resulting (generic) value in the case of success or (generic) error in the case of failure. | |
public enum SpecificResult<Value,Error> { | |
///The task succeeded and returned this value | |
case success(Value) | |
///The task failed with this error |
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 final class Source<T>:SourceProtocol, ExpressibleByArrayLiteral,Collection { | |
public typealias Element = T | |
private let box:_sourceBoxBase<T> | |
public init<P:SourceProtocol>(_ base:P) where P.Element == T { | |
self.box = _sourceBox(base) | |
} | |
public init(_ constant:T) { | |
self.box = _sourceBox(ConstantSource(constant)) |