essential-scala icon indicating copy to clipboard operation
essential-scala copied to clipboard

Missing parameter in Multiple Parameter List code example?

Open mattkohl opened this issue 8 years ago • 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) ?

mattkohl avatar Dec 21 '17 18:12 mattkohl