Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select :: Eq s => Zipper s a -> Zipper s a
- select z
- | ((length zeroVisitsChildren) > 0) = (Zipper
- (fst zeroVisitsChildren)
- (Breadcrumb (fst zeroVisitsChildren) (fst (splitAt ((elemIndex (fst zeroVisitsChildren) childs) - 1)))
- (snd (splitAt ((elemIndex (fst zeroVisitsChildren) childs)))))
- (zipperGen z))
- | otherwise = z
- where childs = (treeChildren (zipperTree z))
- zeroVisitsChildren = [t | t <- childs, (treeVisits t == 0)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement