iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Buffer

Documentation

data Buffer s a Source #

Constructors

Buffer 

Fields

newBuffer :: (Unbox a, PrimMonad m) => Int -> m (Buffer (PrimState m) a) Source #

type Stack s a = Buffer s a Source #

newBufferAsStack :: (Unbox a, PrimMonad m) => Int -> m (Buffer (PrimState m) a) Source #

type Queue s a = Buffer s a Source #

newBufferAsQueue :: (Unbox a, PrimMonad m) => Int -> m (Buffer (PrimState m) a) Source #

type Deque s a = Buffer s a Source #

newBufferAsDeque :: (Unbox a, PrimMonad m) => Int -> m (Buffer (PrimState m) a) Source #

lengthBuffer :: PrimMonad m => Buffer (PrimState m) a -> m Int Source #

clearBuffer :: PrimMonad m => Buffer (PrimState m) a -> m () Source #

freezeBuffer :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Vector a) Source #

unsafeFreezeBuffer :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Vector a) Source #

freezeInternalBuffer :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Vector a) Source #

unsafeFreezeInternalBuffer :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Vector a) Source #

popFront :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Maybe a) Source #

viewFront :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Maybe a) Source #

popBack :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Maybe a) Source #

viewBack :: (Unbox a, PrimMonad m) => Buffer (PrimState m) a -> m (Maybe a) Source #

pushFront :: (Unbox a, PrimMonad m) => a -> Buffer (PrimState m) a -> m () Source #

pushBack :: (Unbox a, PrimMonad m) => a -> Buffer (PrimState m) a -> m () Source #

pushFronts :: (Unbox a, PrimMonad m) => Vector a -> Buffer (PrimState m) a -> m () Source #

pushBacks :: (Unbox a, PrimMonad m) => Vector a -> Buffer (PrimState m) a -> m () Source #