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 TransformedSignallingRef a la TransformedRef #3460

Open
jhenahan opened this issue Aug 1, 2024 · 3 comments
Open

Add TransformedSignallingRef a la TransformedRef #3460

jhenahan opened this issue Aug 1, 2024 · 3 comments

Comments

@jhenahan
Copy link

jhenahan commented Aug 1, 2024

In the work code, I need to lift a SignallingRef into a trace4cats flow, which requires a SignallingRef[F, A] => F ~> G => SignallingRef[G, A]. Unfortunately, .mapK on SignallingRef[F, A] yields a Ref[G, A]. I implemented a

class TransformedSignallingRef[F[_], G[_], A](underlying: SignallingRef[F, A], fk: F ~> G)(implicit ev: Functor[F])

with essentially the same implementation as TransformedRef in cats-effect, I just can't PR it until I've cleared it with the company. The implementation is totally mechanical, though, so I wouldn't be mad if someone beat me to it before I get that done.

If there's already a way to get this kind of translation done without adding this, I'd also be very happy to hear about it.

FS2 version: 3.10.2

@Sanchit-100
Copy link

Hey @armanbilge
I would like to work on this issue.
Could you assign it to me?

@armanbilge
Copy link
Member

@Sanchit-100 great, go for it! Feel free to put up your draft PR early so we can help you :)

@jhenahan
Copy link
Author

jhenahan commented Mar 5, 2025

Happy to assist if needed. The code I ended up with in the work codebase was very much "follow the types", but let me know if I can do anything to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants