Open
Conversation
had this note been in the code, it would have saved me a lot of time :-)
armanbilge
reviewed
Feb 21, 2025
| li( | ||
| // note: the tupling below seems to require explicit type signatures | ||
| // for `todo` and `editing` so that the scala compiler can help us along with `mapN` | ||
| cls <-- (todo: Signal[IO, Option[Todo]], editing: Signal[IO, Boolean]).mapN { (t, e) => |
Owner
There was a problem hiding this comment.
Hmm, maybe we should just rewrite as map2.
Suggested change
| cls <-- (todo: Signal[IO, Option[Todo]], editing: Signal[IO, Boolean]).mapN { (t, e) => | |
| cls <-- todo.map2(editing) { (t, e) => |
Author
There was a problem hiding this comment.
Hmm, at least in my code map2 did not work either. For example, I have something like this:
active.map2(relayUri){
case (true, theUri) => renderSubscription(theUri,filter)
case _ => div("")
}
but that gives me:
No given instance of type cats.Apply[[A] =>> fs2.concurrent.SignallingRef[cats.effect.IO, A]] was found for parameter F of method map2 in class ApplyOps.
I found:
cats.Invariant.catsApplicativeForArrow[F, A²]
But method catsApplicativeForArrow in trait InvariantInstances2 does not match type cats.Apply[[A] =>> fs2.concurrent.SignallingRef[cats.effect.IO, A]]
where: A is a type variable
A² is a type variable
but this:
(active : Signal[IO,Boolean] ,relayUri : Signal[IO,Uri]).mapN {
case (true, theUri) => renderSubscription(theUri,filter)
case _ => div("")
}
compiles just fine.
Owner
There was a problem hiding this comment.
Darn. For the record, here's the relevant issue. I want to take another look at it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
had this note been in the code, it would have saved me a lot of time :-)