Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve readme #4

Merged
merged 2 commits into from
Apr 27, 2024
Merged

improve readme #4

merged 2 commits into from
Apr 27, 2024

Conversation

patroza
Copy link
Contributor

@patroza patroza commented Apr 27, 2024

  • return errors so the compiler can do flow analysis and type narrowing
  • assume Effect.Tag usage to simplify service calls
  • don't use yield* Effect.succeed() as it gives the wrong impression

@kasperpeulen
Copy link
Owner

Thanks!

return errors so the compiler can do flow analysis and type narrowing

I might be missing something, but I get the same type narrowing without returning.

@patroza
Copy link
Contributor Author

patroza commented Apr 27, 2024

@kasperpeulen type narrowing of the value you tested in the if condition.
In your current example there is no type narrowing, but do something like !Array.isNonEmptyArray instead, and you should see the result narrowed to NonEmptyArray after the return.

@kasperpeulen kasperpeulen added documentation Changes only affect the documentation patch Increment the patch version when merged labels Apr 27, 2024
@kasperpeulen
Copy link
Owner

Thanks!

@kasperpeulen kasperpeulen merged commit 0245463 into kasperpeulen:main Apr 27, 2024
Copy link

🚀 PR was released in v0.0.5 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes only affect the documentation patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants