Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Add cats.functor.Invariant instance for fs2.async.mutable.Queue #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OlivierBlanvillain
Copy link

Do you think it would make sense to have an Invariant[mutable.Queue]? I might make more sense to define imap/xmap directly on the queue and do a simple forward in fs2-cats/fs2-scalaz.

@@ -17,6 +20,20 @@ trait Instances extends Instances0 {
implicit def uf1ToNatrualTransformation[F[_], G[_]](implicit uf1: UF1[F, G]): NaturalTransformation[F, G] = new NaturalTransformation[F, G] {
def apply[A](fa: F[A]) = uf1(fa)
}

implicit def catsInvariantQueue[F[_]](implicit F: Functor[F]): Invariant[Queue[F, ?]] =
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what are the implication of using Functor vs CatsFunctor here...

@mpilquist
Copy link
Member

👍 We should probably add imap to fs2.async.mutable.{Queue,Signal,Topic} and then delegate here.

@mpilquist
Copy link
Member

@OlivierBlanvillain Can you update this PR to use imap from fs2-core when you get a chance? Sorry for the delay in merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants