-
Notifications
You must be signed in to change notification settings - Fork 12
Update exercices to use Effect instead of fp-ts #155
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
base: main
Are you sure you want to change the base?
Conversation
Adds Effect dependencies
e6c5383 to
0532cee
Compare
src/exo4 - Dependency injection with Reader/exo4.effect.exercise.ts
Outdated
Show resolved
Hide resolved
src/exo0 - Composing with pipe and flow/exo0.effect.exercise.ts
Outdated
Show resolved
Hide resolved
|
Sure you don't want to either:
Because I've often heard people talk about this repo so to me it sounds look like a bit of a landmark for |
@FredericEspiau, we will probably split the 2 repositories, it's just convenient at first to have both versions while we work on porting the exercices from |
src/exo0 - Composing with pipe and flow/exo0.effect.exercise.ts
Outdated
Show resolved
Hide resolved
| // Implement this function using Effect's APIs | ||
| pipe( | ||
| optionalCountryCode, | ||
| Option.match({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Effect equivalent of option.traverse here would be Effect.transposeMapOption that I added recently in Effect 😏 let's use it! :)
- Removes unused import. - Corrects Either type parameter order to align with the Effect library's convention. - Introduces `Effect.transposeMapOption` for simplifying Option transformations. - Streamlines array traversal using `Option.all` instead of manual reduction.
/!\ This is a simple translation of the exercices, it could benefit from a broader view on how to implement other concepts from Effect that are not part of the current exercices.
How to review:
fp-tstoEffectis correct