-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Effect.unified and Effect.unifiedFn in favour of Unify.unify
- Loading branch information
1 parent
2100344
commit 335ee58
Showing
6 changed files
with
50 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
"effect": minor | ||
--- | ||
|
||
Remove Effect.unified and Effect.unifiedFn in favour of Unify.unify. | ||
|
||
The `Unify` module fully replaces the need for specific unify functions, when before you did: | ||
|
||
```ts | ||
import { Effect } from "effect"; | ||
|
||
const effect = Effect.unified( | ||
Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO") | ||
); | ||
const effectFn = Effect.unifiedFn((n: number) => | ||
Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO") | ||
); | ||
``` | ||
|
||
You can now do: | ||
|
||
```ts | ||
import { Effect, Unify } from "effect"; | ||
|
||
const effect = Unify.unify( | ||
Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO") | ||
); | ||
const effectFn = Unify.unify((n: number) => | ||
Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO") | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters