Skip to content

Bump fs2.version from 0.10.0-M6 to 3.0-1988212 - #119

Closed
dependabot-preview[bot] wants to merge 1 commit into
masterfrom
dependabot/maven/fs2.version-3.0-1988212
Closed

Bump fs2.version from 0.10.0-M6 to 3.0-1988212#119
dependabot-preview[bot] wants to merge 1 commit into
masterfrom
dependabot/maven/fs2.version-3.0-1988212

Conversation

@dependabot-preview

Copy link
Copy Markdown
Contributor

Bumps fs2.version from 0.10.0-M6 to 3.0-1988212.
Updates fs2-io_2.12 from 0.10.0-M6 to 3.0-1988212

Release notes

Sourced from fs2-io_2.12's releases.

v3.0.0-M1

FS2 3.0.0-M1 is the first milestone in the 3.x release series, featuring support for Cats Effect 3. Like Cats Effect 3, we expect a number of milestone releases before a 3.0.0 final release. Neither binary nor source compatibility with FS2 2.x is provided, though APIs are largely the same and porting should not be a large task.

The primary feature of FS2 3.0 is support for the Cats Effect 3 type class hierarchy. The Cats Effect 3.0.0-M1 release notes provide a great overview of the changes.

FS2 3 also includes some notable changes:

Stream Compilation

Streams are converted to effects via expressions like s.compile.toList and s.compile.drain. Calling s.compile on a Stream[F, O] requires an implicit Compiler[F, X] (where X is chosen based on the type of compilation requested).

In FS2 2.x, getting a Compiler[F, X] instance for the effect F generally required a Sync[F] (this is not true for the Pure and Fallible effects but is otherwise accurate). In FS2 3, compilation now only requires a Concurrent[F]. If a Concurrent[F] is not available, then compilation falls back to using a Sync[F] -- this allows stream compilation for effects like SyncIO which do not have a Concurrent instance.

In a polymorphic context, compilation is supported by either adding a Concurrent[F] constraint, or if compilation of non-concurrent effects is needed as well, a Compiler.Target constraint:

import fs2.{Compiler, Stream}
import cats.effect.Concurrent
// Allows compilation for any Concurrent[F] but not for things like SyncIO
def compileThis[F[_]: Concurrent, O](https://github.com/typelevel/fs2/blob/HEAD/f: Stream[F, O]): F[Unit] = f.compile.drain
// Allows compilation for any Concurrent[F] or any Sync[F]
def compileThat[F[_]: Compiler.Target, O](https://github.com/typelevel/fs2/blob/HEAD/f: Stream[F, O]): F[Unit] = f.compile.drain

No More Blocker

The cats.effect.Blocker type was removed in CE 3 -- instead, Sync[F] supports blocking calls via Sync[F].blocking(thunk). As a result, FS2 APIs that took a Blocker have been simplified and in some cases, operations have been combined (e.g., lines & linesAsync have been combined to just lines).

Sinks

The deprecated Sink trait has finally been removed and we now represent sinks via a stream transformation that discards all output values -- Stream[F, O] => Stream[F, Nothing] aka Pipe[F, O, Nothing]. This is different than the old definition of Sink which emitted an undefined number of Unit values -- and as a result of the behavior being undefined, implementations varied widely. Implementations included emitting:

  • 0 unit values
  • 1 unit at termination of the source stream
  • 1 unit per output element from source stream
  • 1 unit per output chunk from source stream
  • etc.

There are a few ergonomic improvements related to the new encoding of sinks:

  • Stream.exec(IO.println(...)) - Stream.exec takes an F[Unit] and returns a Stream[F, Nothing]
  • Stream(1, 2, 3).foreach(IO.println) - The foreach method on Stream takes a O => F[Unit] and returns a Stream[F, Nothing]
  • s.unitary - The unitary method on Stream converts a Stream[F, Nothing] to a Stream[F, Unit] which emits a single unit at termination of s
  • Calling flatMap on a Stream[F, Nothing] no longer compiles, which avoids mistakes that result in unexpected behavior.

Capability Traits

The fs2-io project provides support for working with files and networks, abstracting the Java NIO APIs. The implementations require either Async[F] or Sync[F] depending on whether the underlying NIO API is non-blocking or blocking.

One of the main features of CE3 is the position of the Sync and Async type classes in the hierarchy. As the most powerful type classes, they are now firmly at the bottom of the hierarchy. To avoid requiring Sync / Async constraints in code that uses fs2-io, we are adding capability traits -- traits which limit the capabilities of an effect to a discrete set of operations. The new fs2.io.file.Files[F] capability trait provides the ability to work with files in the effect F. For example:

Commits

Updates fs2-core_2.12 from 0.10.0-M6 to 3.0-1988212

Release notes

Sourced from fs2-core_2.12's releases.

v3.0.0-M1

FS2 3.0.0-M1 is the first milestone in the 3.x release series, featuring support for Cats Effect 3. Like Cats Effect 3, we expect a number of milestone releases before a 3.0.0 final release. Neither binary nor source compatibility with FS2 2.x is provided, though APIs are largely the same and porting should not be a large task.

The primary feature of FS2 3.0 is support for the Cats Effect 3 type class hierarchy. The Cats Effect 3.0.0-M1 release notes provide a great overview of the changes.

FS2 3 also includes some notable changes:

Stream Compilation

Streams are converted to effects via expressions like s.compile.toList and s.compile.drain. Calling s.compile on a Stream[F, O] requires an implicit Compiler[F, X] (where X is chosen based on the type of compilation requested).

In FS2 2.x, getting a Compiler[F, X] instance for the effect F generally required a Sync[F] (this is not true for the Pure and Fallible effects but is otherwise accurate). In FS2 3, compilation now only requires a Concurrent[F]. If a Concurrent[F] is not available, then compilation falls back to using a Sync[F] -- this allows stream compilation for effects like SyncIO which do not have a Concurrent instance.

In a polymorphic context, compilation is supported by either adding a Concurrent[F] constraint, or if compilation of non-concurrent effects is needed as well, a Compiler.Target constraint:

import fs2.{Compiler, Stream}
import cats.effect.Concurrent
// Allows compilation for any Concurrent[F] but not for things like SyncIO
def compileThis[F[_]: Concurrent, O](https://github.com/typelevel/fs2/blob/HEAD/f: Stream[F, O]): F[Unit] = f.compile.drain
// Allows compilation for any Concurrent[F] or any Sync[F]
def compileThat[F[_]: Compiler.Target, O](https://github.com/typelevel/fs2/blob/HEAD/f: Stream[F, O]): F[Unit] = f.compile.drain

No More Blocker

The cats.effect.Blocker type was removed in CE 3 -- instead, Sync[F] supports blocking calls via Sync[F].blocking(thunk). As a result, FS2 APIs that took a Blocker have been simplified and in some cases, operations have been combined (e.g., lines & linesAsync have been combined to just lines).

Sinks

The deprecated Sink trait has finally been removed and we now represent sinks via a stream transformation that discards all output values -- Stream[F, O] => Stream[F, Nothing] aka Pipe[F, O, Nothing]. This is different than the old definition of Sink which emitted an undefined number of Unit values -- and as a result of the behavior being undefined, implementations varied widely. Implementations included emitting:

  • 0 unit values
  • 1 unit at termination of the source stream
  • 1 unit per output element from source stream
  • 1 unit per output chunk from source stream
  • etc.

There are a few ergonomic improvements related to the new encoding of sinks:

  • Stream.exec(IO.println(...)) - Stream.exec takes an F[Unit] and returns a Stream[F, Nothing]
  • Stream(1, 2, 3).foreach(IO.println) - The foreach method on Stream takes a O => F[Unit] and returns a Stream[F, Nothing]
  • s.unitary - The unitary method on Stream converts a Stream[F, Nothing] to a Stream[F, Unit] which emits a single unit at termination of s
  • Calling flatMap on a Stream[F, Nothing] no longer compiles, which avoids mistakes that result in unexpected behavior.

Capability Traits

The fs2-io project provides support for working with files and networks, abstracting the Java NIO APIs. The implementations require either Async[F] or Sync[F] depending on whether the underlying NIO API is non-blocking or blocking.

One of the main features of CE3 is the position of the Sync and Async type classes in the hierarchy. As the most powerful type classes, they are now firmly at the bottom of the hierarchy. To avoid requiring Sync / Async constraints in code that uses fs2-io, we are adding capability traits -- traits which limit the capabilities of an effect to a discrete set of operations. The new fs2.io.file.Files[F] capability trait provides the ability to work with files in the effect F. For example:

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Bumps `fs2.version` from 0.10.0-M6 to 3.0-1988212.

Updates `fs2-io_2.12` from 0.10.0-M6 to 3.0-1988212
- [Release notes](https://github.com/typelevel/fs2/releases)
- [Changelog](https://github.com/typelevel/fs2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/typelevel/fs2/commits)

Updates `fs2-core_2.12` from 0.10.0-M6 to 3.0-1988212
- [Release notes](https://github.com/typelevel/fs2/releases)
- [Changelog](https://github.com/typelevel/fs2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/typelevel/fs2/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
@dependabot-preview

Copy link
Copy Markdown
Contributor Author

Superseded by #120.

@dependabot-preview
dependabot-preview Bot deleted the dependabot/maven/fs2.version-3.0-1988212 branch October 22, 2020 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants