|
|
|
Description |
An implementation of a zipper-like non-empty list structure that tracks
an index position in the list (the focus).
|
|
Synopsis |
|
|
|
Documentation |
|
|
The implementation of the pointed list structure which tracks the current
position in the list structure.
| Constructors | PointedList | | reversedPrefix :: [a] | | _focus :: a | | suffix :: [a] | |
|
| Instances | |
|
|
|
Focus element accessor label.
|
|
|
Create a PointedList with a single element.
|
|
|
Possibly create a Just PointedList if the provided list has at least
one element; otherwise, return Nothing.
The provided list's head will be the focus of the list, and the rest of
list will follow on the right side.
|
|
|
Possibly create a Just PointedList if the provided list has at least
one element; otherwise, return Nothing.
The provided list's last element will be the focus of the list, following
the rest of the list in order, to the left.
|
|
|
Replace the focus of the list, retaining the prefix and suffix.
|
|
|
Possibly move the focus to the next element in the list.
|
|
|
Attempt to move the focus to the next element, or error if there are
no more elements.
|
|
|
Possibly move the focus to the previous element in the list.
|
|
|
Attempt to move the focus to the previous element, or error if there are
no more elements.
|
|
|
An alias for insertRight.
|
|
|
Insert an element to the left of the focus, then move the focus to the new
element.
|
|
|
Insert an element to the right of the focus, then move the focus to the
new element.
|
|
|
An alias of deleteRight.
|
|
|
Possibly delete the element at the focus, then move the element on the
left to the focus. If no element is on the left, focus on the element to
the right. If the deletion will cause the list to be empty, return
Nothing.
|
|
|
Possibly delete the element at the focus, then move the element on the
right to the focus. If no element is on the right, focus on the element to
the left. If the deletion will cause the list to be empty, return
Nothing.
|
|
|
Delete all elements in the list except the focus.
|
|
|
The length of the list.
|
|
|
Whether the focus is the first element.
|
|
|
Whether the focus is the last element.
|
|
|
Create a PointedList of variations of the provided PointedList, in
which each element is focused, with the provided PointedList as the
focus of the sets.
|
|
|
Map over the PointedLists created via positions, such that f is
called with each element of the list focused in the provided
PointedList. An example makes this easier to understand:
contextMap atStart (fromJust $ fromList [1..5])
|
|
|
Create a PointedList a of (a, Bool), in which the boolean values
specify whether the current element has the focus. That is, all of the
booleans will be False, except the focused element.
|
|
|
Move the focus to the specified index.
|
|
|
Move the focus by n, relative to the current index. Negative values move
the focus backwards, positive values more forwards through the list.
|
|
|
Move the focus to the specified element, if it is present.
Patch with much faster algorithm provided by Runar Bjarnason for version
0.3.2. Improved again by Runar Bjarnason for version 0.3.3 to support
infinite lists on both sides of the focus.
|
|
|
The index of the focus.
|
|
Produced by Haddock version 2.6.1 |