diff --git a/src/result.ts b/src/result.ts index 37186e8..513370e 100644 --- a/src/result.ts +++ b/src/result.ts @@ -15,19 +15,24 @@ export class Result { } /** - * Represents a failure + * Create a box representing failure */ static Err(err: E) { return new Result({ isOk: false, err }); } /** - * Represents a success + * Create a box representing success */ static Ok(value: T) { return new Result({ isOk: true, value }); } + /** + * Combine record of boxes and return either record with their unboxed values + * if all boxes represent a success or the first box representing failure + * otherwise + */ static all>>>( xs: T, ): Result<