Skip to content

Commit

Permalink
#4 - Fix reducel for Node2
Browse files Browse the repository at this point in the history
  • Loading branch information
alf239 committed May 4, 2019
1 parent 2676ecb commit 1914507
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/finger/Fingers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object Fingers {
}

override def reducel[A, B](fn: (B, A) => B): (B, Node[A]) => B = (z, na) => na match {
case Node2(a, b) => fn(z, fn(b, a))
case Node2(a, b) => fn(fn(z, b), a)
case Node3(a, b, c) => fn(fn(fn(z, c), b), a)
}
}
Expand Down

0 comments on commit 1914507

Please sign in to comment.