underscoreio/essential-scala

Missing parameter in Multiple Parameter List code example?

Opened this issue · 0 comments

in essential-scala/src/pages/sequencing/working-with-data.md, where fold is rewritten with multiple parameters:

def fold[B](end: B)(pair: (A, B) => B): B =
  this match {
    case End() => end
    case Pair(hd, tl) => pair(hd, tl.fold(end, pair))
  }

Should the parameters of tl.fold(end, pair) be split into tl.fold(end)(pair) ?