When a Zipper is created with an empty context (e.g. via Group#toZipper), the resulting Zipper does not define a workingflatMap. If this were just a result of toZipper, then it would be excusable. Unfortunately, this arises when actually using Zipper normally:
val g: Group[Node] = ...
(g \ "foo").unselect flatMap { e => Some(e) } // => Group(), regardless of what g is
This appears to be a product of the fact that flatMap builds its result by mapping over the zipper context. Since that context is empty after unselect (in this case), the result will always be Group().
When a
Zipper
is created with an empty context (e.g. viaGroup#toZipper
), the resultingZipper
does not define a workingflatMap
. If this were just a result oftoZipper
, then it would be excusable. Unfortunately, this arises when actually usingZipper
normally:This appears to be a product of the fact that
flatMap
builds its result by mapping over the zipper context. Since that context is empty afterunselect
(in this case), the result will always beGroup()
.