Last active
May 23, 2019 22:40
-
-
Save jeremycochoy/f8d6419d898607f03bafbb7610c81bc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zippy = ListZipper<String>(from: ["I", "love", "pancakes"]) | |
print(zippy.cursor!) // I | |
zippy.right() // move to the right | |
print(zippy.cursor!) // love | |
zippy.cursor = "hate" | |
print(zippy.toList().joined(separator: " ")) // I hate pancakes | |
zippy.remove() | |
zippy.cursor = "Eat" | |
print(zippy.toList().joined(separator: " ")) // Eat pancakes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment