Skip to content
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

Improve description of InvariantOps #2860

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/shared/src/main/scala/fs2/Stream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down