How to read Scala code with lots of implicits?
- by Petr Pudlák
Consider the following code fragment (adapted from http://stackoverflow.com/a/12265946/1333025):
// Using scalaz 6
import scalaz._, Scalaz._
object Example extends App {
case class Container(i: Int)
def compute(s: String): State[Container, Int] = state {
case Container(i) => (Container(i + 1), s.toInt + i)
}
val d = List("1",…