The current design looks a bit like this:
enum Result<Value, Error> {
case success(Value)
case failure(Error)
var value: Value?
var error: Error?
var isSuccess: Bool
}
I'd like to point out that a pitch of mine from awhile back would synthesize these properties automatically for any enum, and support for this is crucial for fleshing out the enum key path story:
Because of this, I think we'd probably want the properties to be consistent with the case names:
enum Result<Value, Error> {
case success(Value)
case failure(Error)
- var value: Value?
+ var success: Value?
- var error: Error?
+ var failure: Error?
var isSuccess: Bool
+ var isFailure: Bool
}