// Copyright © 2024 Ryan Booker. All rights reserved.

import Foundation

public extension Result {
    func reduce<T>(
        success successResult: (Success) -> T,
        failure failureResult: (Failure) -> T
    ) -> T {
        switch self {
        case let .success(value):
            successResult(value)
        case let .failure(error):
            failureResult(error)
        }
    }
}