St

Streams in Elixir

4 exercises

About Streams

The Stream module is a lazy alternative to the eager Enum module. Streams:

  • Implement the Enumerable protocol.
  • Are composable.
  • Are internally represented as functions.
  • Can be infinite.

Streams are ideal for dealing with slow resources and very large, potentially infinite, collections. For all other cases, use Enum instead.

Edit via GitHub The link opens in a new window or tab

Learn Streams