Elixir Streams
I previously wrote about explicitness in Elixir. One of my favorite ways the language embraces explicitness is in its distinction between eager and lazy operations on collections. Any time you use the Enum module, you’re performing an eager operation. Your collection will be transformed/mapped/enumerated immediately. When you use the Stream module, you’re performing lazy operations. The Stream module provides many of the same operations as Enum, but when used with Stream they’re describing future computations rather than actions to be taken immediately. Conveniently, all streams also implement the Enumerable protocol, meaning they can use any of the functions within Enum. ...