src/scan/CursorCleanupPolicy.bend

mylsm-lsm-store@0.6.0.0 · 12 lines · 0 definitions

1import Base
2
3# Preserves the first cleanup failure and otherwise returns the final result.
4def combine(
5  a,
6  -E: Kind(a),
7  first: Result<a, &1, E, Unit>,
8  second: Result<a, &1, E, Unit>
9) -> Result<a, &1, E, Unit>:
10  match first:
11    case Fail{error}: Fail{error}
12    case Done{Unit{}}: second