Skip to content

Missing parameter in Multiple Parameter List code example? #58

Open
@mattkohl

Description

@mattkohl

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) ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions