Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

Zipper With Empty Context Does Not Define flatMap #13

Closed
djspiewak opened this issue May 11, 2011 · 0 comments
Closed

Zipper With Empty Context Does Not Define flatMap #13

djspiewak opened this issue May 11, 2011 · 0 comments
Assignees

Comments

@djspiewak
Copy link
Owner

When a Zipper is created with an empty context (e.g. via Group#toZipper), the resulting Zipper does not define a working flatMap. 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().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant