Skip to content

Add TransformedSignallingRef a la TransformedRef #3460

@jhenahan

Description

@jhenahan

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions