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

Simplify construction of capabilities, so they don't require the app type #241

Merged
merged 4 commits into from
May 20, 2024

Conversation

charypar
Copy link
Member

This was preventing having Apps with generic parameters, because the Effect derive macro would want the type name for the App.

Turns out that was down to the type definition of WithContext which required the App type, but doesn't strictly need to. It's job is to map capability's output to type Effect (wrapping it).

WithEffect can now, strictly speaking, be implemented on anything, but we do restrict it down to being the App's capabilities type further up the chain in Core::new.

A nice side effect (possibly independent?) is that Core::new no longer needs to be generic. Sadly that also makes this a breaking change 😢

Copy link
Member

@StuartHarris StuartHarris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much nicer!

@charypar charypar requested a review from obmarg May 20, 2024 13:03
@StuartHarris StuartHarris merged commit f2bc473 into master May 20, 2024
9 checks passed
@StuartHarris StuartHarris deleted the viktor/relax-effect-macro branch May 20, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants