Skip to content

Commit e80b0ec

Browse files
committed
feat: update changelog with all and sequence combinators for monads
1 parent ea72f9d commit e80b0ec

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/changelog.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
---
88

9+
## [Unreleased]
10+
11+
### Added
12+
- **`all` combinator for `Maybe`, `Result`, and `Either`**: Combines an array of monads into a single monad containing an array of values.
13+
- `Maybe`: Returns `Just` with all values if all are `Just`, or `Nothing` if any is `Nothing`.
14+
- `Result`/`Either`: Collects **all** errors if any fail.
15+
- Example:
16+
```ts
17+
all([just(1), just(2), just(3)]).unwrapOr([]); // [1, 2, 3]
18+
all([ok(1), err('e1'), err('e2')]); // Err(['e1', 'e2'])
19+
```
20+
21+
- **`sequence` combinator for `Result` and `Either`**: Combines an array of monads with fail-fast behavior.
22+
- Stops at the **first** error instead of collecting all errors.
23+
- Returns single error type instead of array.
24+
- Example:
25+
```ts
26+
sequence([ok(1), err('e1'), err('e2')]); // Err('e1') - stops at first!
27+
// vs all: Err(['e1', 'e2']) - collects all
28+
```
29+
30+
---
31+
932
## [[1.1.0]](https://github.com/richecr/holo-fn/releases/tag/v1.1.0) - 2025-11-30
1033

1134
### Added

0 commit comments

Comments
 (0)