From e3656937d1d9c2f5b2ca7a40b1c76e8a1420e57f Mon Sep 17 00:00:00 2001 From: Joshua Date: Sat, 10 Jan 2026 13:44:55 +0000 Subject: [PATCH 1/2] minor type fixes to Result --- .changeset/minor-result-type-fixes.md | 8 ++++++++ packages/atom/src/Result.ts | 8 ++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .changeset/minor-result-type-fixes.md diff --git a/.changeset/minor-result-type-fixes.md b/.changeset/minor-result-type-fixes.md new file mode 100644 index 00000000..33db0eb1 --- /dev/null +++ b/.changeset/minor-result-type-fixes.md @@ -0,0 +1,8 @@ +--- +"@effect-atom/atom": patch +--- + +Minor type fixes to Result type: +- Fix `flatMap` overload signature to correctly return `Result` instead of `Result` +- Add explicit type parameters to `initial` call in `waitingFrom` to preserve type information +- Remove duplicate `when` method overload in `BuilderImpl` diff --git a/packages/atom/src/Result.ts b/packages/atom/src/Result.ts index eae8a4e8..881faa1a 100644 --- a/packages/atom/src/Result.ts +++ b/packages/atom/src/Result.ts @@ -136,7 +136,7 @@ export const fromExitWithPrevious = ( */ export const waitingFrom = (previous: Option.Option>): Result => { if (previous._tag === "None") { - return initial(true) + return initial(true) } return waiting(previous.value) } @@ -413,7 +413,7 @@ export const map: { * @category combinators */ export const flatMap: { - (f: (a: A, prev: Success) => Result): (self: Result) => Result + (f: (a: A, prev: Success) => Result): (self: Result) => Result (self: Result, f: (a: A, prev: Success) => Result): Result } = dual(2, (self: Result, f: (a: A, prev: Success) => Result): Result => { switch (self._tag) { @@ -651,10 +651,6 @@ class BuilderImpl { refinement: Refinement, B>, f: (result: B) => Option.Option ): any - when( - refinement: Predicate>, - f: (result: Result) => Option.Option - ): any when( refinement: Predicate>, f: (result: Result) => Option.Option From f958b7e1ff83e21c0dd3ce82242f2b9074f39dae Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 15 Jan 2026 10:53:47 +0000 Subject: [PATCH 2/2] reduce changeset comment --- .changeset/minor-result-type-fixes.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.changeset/minor-result-type-fixes.md b/.changeset/minor-result-type-fixes.md index 33db0eb1..009fabf7 100644 --- a/.changeset/minor-result-type-fixes.md +++ b/.changeset/minor-result-type-fixes.md @@ -2,7 +2,4 @@ "@effect-atom/atom": patch --- -Minor type fixes to Result type: -- Fix `flatMap` overload signature to correctly return `Result` instead of `Result` -- Add explicit type parameters to `initial` call in `waitingFrom` to preserve type information -- Remove duplicate `when` method overload in `BuilderImpl` +fix Result type signatures