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

add InvariantK instance for Mid #1112

Closed
GreyPlane opened this issue Apr 7, 2023 · 0 comments
Closed

add InvariantK instance for Mid #1112

GreyPlane opened this issue Apr 7, 2023 · 0 comments

Comments

@GreyPlane
Copy link
Contributor

I found it quite useful for example because I'm using Future and wanna implement a Cache middleware so I have to make my effect lazily by Lazy[Future], so my type will be Service[Mid[Lambda[a => Lazy[Future[a]], *]], buy my Metrics middleware remains Future, so instead of change Metrics' effect type to Lazy[Future] and manually wrap and unwrap Lazy in every call, I think it is a lot easier to just map Mid[Future, *] to Mid[Lambda[a => Lazy[Future[a]], *] which can be done by InvariantK.imapK.

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

No branches or pull requests

1 participant