Skip to content

Instantly share code, notes, and snippets.

@jeremycochoy
Created May 23, 2019 22:27
Show Gist options
  • Save jeremycochoy/a2aa1a8d20bfa9ff62beb7e24ddb0443 to your computer and use it in GitHub Desktop.
Save jeremycochoy/a2aa1a8d20bfa9ff62beb7e24ddb0443 to your computer and use it in GitHub Desktop.
/// Map a function to the tracks
func map<R>(f: (T) -> R) -> ListZipper<R> {
var zipper = ListZipper<R>()
zipper.leftList = leftList.map(f)
zipper.cursor = cursor.map(f)
zipper.rightList = rightList.map(f)
return zipper
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment