Safe Haskell | None |
---|
Data.RingBuffer.Class
Description
The RingBuffer interface.
A RingBuffer is a fixed-length buffer that supports lookups anywhere in the structure and pushing new elements onto the front. When a new value is pushed, the oldest value will be dropped.
This module provides an implementation based on
Vector
, with O(1) lookups and O(n) pushes. Other
modules provide implementations with different performance profiles.
Documentation
class RingBuffer c whereSource
The RingBuffer interface.
Instances must define length
, push
, and '(!)'. Instances may define
slice
for better performance.
Methods
Instances
class Initializable c whereSource
Create a new Initializable
with the given value at every position.
Essentially a generalized replicate
Instances