Home

Awesome

Flatten your code

This project is a hands-on tutorial with exercises and answers, that teaches how to flatten stacked containers like Future[Option[A]] so that they can be used in for-comprehensions.

There's an accompanying presentation: https://speakerdeck.com/eamelink/flatten-your-code

Prerequisites

Usage

Most of the code is not runnable: we only rely on the typechecker. That means it's critical to look at the code in an IDE (or ENSIME) that can show you the type of values.

Structure

There are two sbt projects: basics and play-specific.

The first 14 parts are in basics. There is a package flatten with the tutorial and exercises, and a package answers with answers to the exercises.

The final 3 parts are in the controllers package of play-specific.

ToC

Scalaz documentation

You can find Scalaz documentation on the http://docs.typelevel.org/