FS2 - CRASH COURSE
summary
A ten-minute crash course shows FS2 producing pull-based effectful streams with IO, using evalMap for per-element side effects and bracket resource handling for safe acquisition/release. Examples include generating an infinite random stream and taking four elements, zipping streams, and streaming a Doobie database query into a JSON array (emit “[”, stream mapped rows with commas, emit “]”), plus a custom pipe that folds every four items into a summed output using a semigroup — stack-safe and working as shown.
AI-written summary · about








