CarCache.CircularZipperList (CarCache v0.1.1) View Source
A simple functional zipper list used to approximate a circular buffer.
Based on: https://ferd.ca/yet-another-article-on-zippers.html
Link to this section Summary
Functions
Insert a value before the current cursor and set the cursor to the new value
Get the length of the entire list
Create a new/empty circular zipper list
Move the cursor to the next item in the list
Move the cursor to the previous item in the list
Remove the value at the current cursor
Replace the value at the current cursor
Get the value at the current cursor
Link to this section Types
Specs
Link to this section Functions
Specs
Insert a value before the current cursor and set the cursor to the new value
Specs
len(t()) :: non_neg_integer()
Get the length of the entire list
Specs
new() :: t()
Create a new/empty circular zipper list
Specs
Move the cursor to the next item in the list
Specs
Move the cursor to the previous item in the list
Specs
Remove the value at the current cursor
Specs
Replace the value at the current cursor
Specs
Get the value at the current cursor