From b4f52a83ce9ebd527b94aeede437b236f621d8ed Mon Sep 17 00:00:00 2001 From: Ben Plommer Date: Mon, 28 Mar 2022 13:26:08 +0100 Subject: [PATCH] Improve description of InvariantOps --- core/shared/src/main/scala/fs2/Stream.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/shared/src/main/scala/fs2/Stream.scala b/core/shared/src/main/scala/fs2/Stream.scala index c150b8fa7a..c80936aa5c 100644 --- a/core/shared/src/main/scala/fs2/Stream.scala +++ b/core/shared/src/main/scala/fs2/Stream.scala @@ -3790,7 +3790,10 @@ object Stream extends StreamLowPriority { )(s) .stream - /** Provides syntax for streams that are invariant in `F` and `O`. */ + /** A view of `Stream` that removes the variance from the type parameters. This allows + * defining syntax in which the type parameters appear in contravariant (i.e. input) + * position, which would fail to compile if defined as instance methods. + */ implicit final class InvariantOps[F[_], O](private val self: Stream[F, O]) extends AnyVal { /** Lifts this stream to the specified effect type.