- data ListZipper a = ListZipper ![a] ![a]
- empty :: ListZipper a
- singleton :: a -> ListZipper a
- fromList :: [a] -> ListZipper a
- fromListEnd :: [a] -> ListZipper a
- toList :: ListZipper a -> [a]
- atStart :: ListZipper a -> Bool
- atEnd :: ListZipper a -> Bool
- isEmpty :: ListZipper a -> Bool
- getCurrent :: ListZipper a -> Maybe a
- getLeft :: ListZipper a -> Maybe a
- getRight :: ListZipper a -> Maybe a
- getFirst :: ListZipper a -> Maybe a
- getLast :: ListZipper a -> Maybe a
- getLeftCircular :: ListZipper a -> Maybe a
- getRightCircular :: ListZipper a -> Maybe a
- get :: ListZipper a -> Int -> Maybe a
- focusLeft :: ListZipper a -> Maybe (ListZipper a)
- focusRight :: ListZipper a -> Maybe (ListZipper a)
- focusFirst :: ListZipper a -> Maybe (ListZipper a)
- focusLast :: ListZipper a -> Maybe (ListZipper a)
- focus :: Int -> ListZipper a -> Maybe (ListZipper a)
- focusNode :: Eq a => a -> ListZipper a -> Maybe (ListZipper a)
- insertLeft :: a -> ListZipper a -> ListZipper a
- insertRight :: a -> ListZipper a -> ListZipper a
- insertFirst :: a -> ListZipper a -> ListZipper a
- insertLast :: a -> ListZipper a -> ListZipper a
- delete :: ListZipper a -> Maybe (ListZipper a)
- deleteLeft :: ListZipper a -> Maybe (ListZipper a)
- deleteRight :: ListZipper a -> Maybe (ListZipper a)
- deleteFirst :: ListZipper a -> Maybe (ListZipper a)
- deleteLast :: ListZipper a -> Maybe (ListZipper a)
- deleteOthers :: ListZipper a -> Maybe (ListZipper a)
- deleteNode :: Eq a => a -> ListZipper a -> Maybe (ListZipper a)
- swapLeft :: ListZipper a -> Maybe (ListZipper a)
- swapRight :: ListZipper a -> Maybe (ListZipper a)
- replace :: a -> ListZipper a -> Maybe (ListZipper a)
- length :: ListZipper a -> Int
- currentIndex :: ListZipper a -> Int
- leftIndex :: ListZipper a -> Int
- rightIndex :: ListZipper a -> Int
- firstIndex :: ListZipper a -> Int
- lastIndex :: ListZipper a -> Int
Documentation
empty :: ListZipper aSource
Create an empty ListZipper.
singleton :: a -> ListZipper aSource
Create a ListZipper with a single element.
fromList :: [a] -> ListZipper aSource
Create a ListZipper from list, and focus focus to first element in list.
fromListEnd :: [a] -> ListZipper aSource
Create a ListZipper from list end, and focus focus to end element in list.
toList :: ListZipper a -> [a]Source
Convert ListZipper to List.
atStart :: ListZipper a -> BoolSource
Whether is first element.
atEnd :: ListZipper a -> BoolSource
Whether is last element.
isEmpty :: ListZipper a -> BoolSource
Whether is empty.
getCurrent :: ListZipper a -> Maybe aSource
Get current node, return Nothing if haven't found anything at current node. This function won't change current focus node.
getLeft :: ListZipper a -> Maybe aSource
Get left node, return Nothing if haven't found anything at left node. This function won't change current focus node.
getRight :: ListZipper a -> Maybe aSource
Get right node, return Nothing if haven't found anything at right node. This function won't change current focus node.
getFirst :: ListZipper a -> Maybe aSource
Get first node, return Nothing if haven't found anything at first node. This function won't change current focus node.
getLast :: ListZipper a -> Maybe aSource
Get last node, return Nothing if haven't found anything at last node. This function won't change current focus node.
getLeftCircular :: ListZipper a -> Maybe aSource
Get left node, return Nothing if haven't found anything at left node. If reach first node, circular to end node. This function won't change current focus node.
getRightCircular :: ListZipper a -> Maybe aSource
Get right node, return Nothing if haven't found anything at right node. If reach last node, circular to first node. This function won't change current focus node.
get :: ListZipper a -> Int -> Maybe aSource
Get node with given index. This function won't change current focus node.
focusLeft :: ListZipper a -> Maybe (ListZipper a)Source
Focus left node.
focusRight :: ListZipper a -> Maybe (ListZipper a)Source
Focus right node.
focusFirst :: ListZipper a -> Maybe (ListZipper a)Source
Focus first node.
focusLast :: ListZipper a -> Maybe (ListZipper a)Source
Focus last node.
focus :: Int -> ListZipper a -> Maybe (ListZipper a)Source
Focus node with given index.
focusNode :: Eq a => a -> ListZipper a -> Maybe (ListZipper a)Source
Focus node.
insertLeft :: a -> ListZipper a -> ListZipper aSource
Insert node to right side and keep current focus.
insertRight :: a -> ListZipper a -> ListZipper aSource
Insert node to left side and keep current focus. Except it will focus first element when list is empty.
insertFirst :: a -> ListZipper a -> ListZipper aSource
Insert node to first and keep current focus.
insertLast :: a -> ListZipper a -> ListZipper aSource
Insert node to last end and keep current focus.
delete :: ListZipper a -> Maybe (ListZipper a)Source
Delete current node and focus focus right node.
deleteLeft :: ListZipper a -> Maybe (ListZipper a)Source
Delete left node and keep current focus.
deleteRight :: ListZipper a -> Maybe (ListZipper a)Source
Delete right node and keep current focus.
deleteFirst :: ListZipper a -> Maybe (ListZipper a)Source
Delete first node and keep current focus.
deleteLast :: ListZipper a -> Maybe (ListZipper a)Source
Delete last node and keep current focus.
deleteOthers :: ListZipper a -> Maybe (ListZipper a)Source
Delete other node except current node.
deleteNode :: Eq a => a -> ListZipper a -> Maybe (ListZipper a)Source
Delete specify node.
swapLeft :: ListZipper a -> Maybe (ListZipper a)Source
Swap with left node, and focus swap node.
swapRight :: ListZipper a -> Maybe (ListZipper a)Source
Swap with right node, and focus swap node.
replace :: a -> ListZipper a -> Maybe (ListZipper a)Source
Replace current node.
length :: ListZipper a -> IntSource
Get length.
currentIndex :: ListZipper a -> IntSource
Get current index.
leftIndex :: ListZipper a -> IntSource
Get left index.
rightIndex :: ListZipper a -> IntSource
Get right index.
firstIndex :: ListZipper a -> IntSource
Get first index.
lastIndex :: ListZipper a -> IntSource
Get last index.