Skip to main content

Infinity in the palm of your hand

1 hour 

Infinite data is a large concern in streaming, but as a concept it’s impossible to fathom. In this tutorial, we’ll develop an intuition for infinite streams in fs2. We’ll see how fs2 describes infinite processes, and build a model for understanding them.

You will learn

You should already

This tutorial only deals with pure streams — you don’t need to know anything about IO or side-effects to follow it.

Follow along

Assuming you’re familiar with SBT, create a build.sbt file with the following contents.

ThisBuild / scalaVersion := "3.2.0"
ThisBuild / libraryDependencies += "co.fs2" %% "fs2-core" % "3.7.0"

ThisBuild / initialCommands := s"""
    import fs2._
  """

Then enter the console with sbt console.