-
Notifications
You must be signed in to change notification settings - Fork 9
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
SignallingRef
has to be upcast to Signal
for syntax
#40
Comments
This should be fixed by #183 shouldn't it? |
Unfortunately not, this is really an FS2 issue. //> using lib "co.fs2::fs2-core::3.6.1"
import cats.effect.IO
import cats.syntax.all.*
import fs2.concurrent.{Signal, SignallingRef}
def sigRef: SignallingRef[IO, String] = ???
@main def main =
(sigRef: Signal[IO, String]).void
sigRef.void
But, I just had an idea how to fix it :) |
Erm, spoke too soon :) I thought the problem is in FS2, but it's not really. You can't have a So it turns out, this is something that would need to be fixed in Cats 😂 the question is, if you have I have a hard time imagining such a major change like that being made in Cats. That said, maybe the fix is to add an |
One more datapoint: experimented with the Edit: Ha wait, totally screwed that up. It does work! So that's very interesting 🤔 trait Functor[F[_]]:
extension [A](fa: F[A]) def map[B](f: A => B): F[B]
trait Foo[A]
object Foo:
given Functor[Foo] = ???
trait Bar[A] extends Foo[A]
def foo: Foo[String] = ???
def bar: Bar[String] = ???
@main def main =
foo.map(_.length)
bar.map(_.length) |
This is annoying.
The text was updated successfully, but these errors were encountered: