The context that the cursor is available in.
The type class including the operations needed for withFocusM
.
The type returned by navigation and modifications operations.
Attempt to decode the focus as an A
.
Delete the focus and move to its parent.
Delete the focus and move to the sibling with the given key in a JSON object.
Delete the focus and move to the first element in a JSON array.
Delete the focus and move to the last element in a JSON array.
Delete the focus and move to the left in a JSON array.
Delete the focus and move to the right in a JSON array.
Delete all values to the left of the focus in a JSON array.
Delete all values to the right of the focus in a JSON array.
If the focus is a JSON array, move to its first element.
If the focus is a JSON array, move to the first element that satisfies the given predicate.
If the focus is a JSON object, move to the value of the given key.
If the focus is a JSON array, move to the element at the given index.
If the focus is a value in a JSON object, move to a sibling with the given key.
If the focus is a JSON object, return its field names in a set.
If the focus is a JSON object, return its field names in their original order.
If the focus is an element in a JSON array, find the first element at or to its right that matches the given predicate.
If the focus is an element in a JSON array, move to the first element.
The current location in the document.
Attempt to decode the value at the given key in a JSON object as an A
.
If the focus is an element in a JSON array, move to the last element.
If the focus is an element in a JSON array, move to the left.
If the focus is an element in a JSON array, move to the left until the given predicate matches the new focus.
If the focus is an element in JSON array, move to the left the given number of times.
If the focus is an element in JSON array, move to the left the given number of times.
A negative value will move the cursor right.
If the focus is a JSON array, return the elements to the left.
Replay history (a list of operations in reverse "chronological" order) against this cursor.
If the focus is an element in a JSON array, move to the right.
If the focus is an element in a JSON array, move to the right until the given predicate matches the new focus.
If the focus is an element in JSON array, move to the right the given number of times.
If the focus is an element in JSON array, move to the right the given number of times.
A negative value will move the cursor left.
If the focus is a JSON array, return the elements to the right.
Replace all values to the left of the focus in a JSON array.
Replace all values to the right of the focus in a JSON array.
Return to the root of the document.
Move the focus to the parent.
Modify the focus using the given function.
Modify the focus in a context using the given function.
Attempt to decode the value at the given key in a JSON object as an A
.
Attempt to decode the value at the given key in a JSON object as an A
.
If the field k
is missing, then use the fallback
instead.
Replace the focus.
A zipper that represents a position in a JSON document and supports navigation and modification.
The
focus
represents the current position of the cursor; it may be updated withwithFocus
or changed using navigation methods likeleft
andright
.circe includes three kinds of cursors. Cursor is the simplest: it doesn't keep track of its history. HCursor is a cursor that does keep track of its history, but does not represent the possibility that a navigation or modification operation has failed. ACursor is the richest cursor, since it both tracks history through an underlying HCursor and can represent failed operations.
GenericCursor is an abstraction over these three types, and it has several abstract type members that are required in order to represent the different roles of the three cursor types.
Self
is simply the specific type of the cursor,Focus
is a type constructor that represents the context in which the focus is available,Result
is the type that is returned by all navigation and modification operations, andM
is a type class that includes the operations that we need forwithFocusM
.