tonymorris/fp-course

ListZipper.findLeft

AlexeyRaga opened this issue · 0 comments

The algorithm for ListZipper.findLeft is defined as:

Seek to the left for a location matching a predicate, starting from the current one.

However, the solution uses the break function which does not move left, but breaks on the first matching position on the left side of ListZipper, but starting from the beginning of the left list.

In other words, because of seek to the left ... starting from the current, in the example of

-- >>> findLeft (== 1) (zipper [1, 2, 1] 3 [4, 5])

shouldn't the result be

-- [1,2] >1< [3,4,5]

instead of

-- [2,1] >1< [3,4,5]

as it currently shown in the answers?