Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. select :: Eq s => Zipper s a -> Zipper s a
  2. select z
  3. | ((length zeroVisitsChildren) > 0) = (Zipper
  4. (fst zeroVisitsChildren)
  5. (Breadcrumb (fst zeroVisitsChildren) (fst (splitAt ((elemIndex (fst zeroVisitsChildren) childs) - 1)))
  6. (snd (splitAt ((elemIndex (fst zeroVisitsChildren) childs)))))
  7. (zipperGen z))
  8. | otherwise = z
  9. where childs = (treeChildren (zipperTree z))
  10. zeroVisitsChildren = [t | t <- childs, (treeVisits t == 0)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement