cursors on an immutable data structure