Hoogle Search

Within LTS Haskell 24.67 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. dequeToList :: forall (v :: Type -> Type -> Type) a m . (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m [a]

    rio RIO.Deque

    Convert a Deque into a list. Does not modify the Deque.

  2. dequeToVector :: forall v' a (v :: Type -> Type -> Type) m . (Vector v' a, MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (v' a)

    rio RIO.Deque

    Convert to an immutable vector of any type. If resulting pure vector corresponds to the mutable one used by the Deque, it will be more efficient to use freezeDeque instead.

    Example

    >>> :set -XTypeApplications
    
    >>> import qualified RIO.Vector.Unboxed as U
    
    >>> import qualified RIO.Vector.Storable as S
    
    >>> d <- newDeque @U.MVector @Int
    
    >>> mapM_ (pushFrontDeque d) [0..10]
    
    >>> dequeToVector @S.Vector d
    [10,9,8,7,6,5,4,3,2,1,0]
    

  3. foldlDeque :: forall (v :: Type -> Type -> Type) a m acc . (MVector v a, PrimMonad m) => (acc -> a -> m acc) -> acc -> Deque v (PrimState m) a -> m acc

    rio RIO.Deque

    Fold over a Deque, starting at the beginning. Does not modify the Deque.

  4. foldrDeque :: forall (v :: Type -> Type -> Type) a m acc . (MVector v a, PrimMonad m) => (a -> acc -> m acc) -> acc -> Deque v (PrimState m) a -> m acc

    rio RIO.Deque

    Fold over a Deque, starting at the end. Does not modify the Deque.

  5. freezeDeque :: (Vector v a, PrimMonad m) => Deque (Mutable v) (PrimState m) a -> m (v a)

    rio RIO.Deque

    Yield an immutable copy of the underlying mutable vector. The difference from dequeToVector is that the the copy will be performed with a more efficient memcpy, rather than element by element. The downside is that the resulting vector type must be the one that corresponds to the mutable one that is used in the Deque.

    Example

    >>> :set -XTypeApplications
    
    >>> import qualified RIO.Vector.Unboxed as U
    
    >>> d <- newDeque @U.MVector @Int
    
    >>> mapM_ (pushFrontDeque d) [0..10]
    
    >>> freezeDeque @U.Vector d
    [10,9,8,7,6,5,4,3,2,1,0]
    

  6. getDequeSize :: forall m (v :: Type -> Type -> Type) a . PrimMonad m => Deque v (PrimState m) a -> m Int

    rio RIO.Deque

    O(1) - Get the number of elements that is currently in the Deque

  7. newDeque :: forall (v :: Type -> Type -> Type) a m . (MVector v a, PrimMonad m) => m (Deque v (PrimState m) a)

    rio RIO.Deque

    Create a new, empty Deque

  8. popBackDeque :: forall (v :: Type -> Type -> Type) a m . (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a)

    rio RIO.Deque

    Pop the first value from the end of the Deque

  9. popFrontDeque :: forall (v :: Type -> Type -> Type) a m . (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a)

    rio RIO.Deque

    Pop the first value from the beginning of the Deque

  10. pushBackDeque :: forall (v :: Type -> Type -> Type) a m . (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> a -> m ()

    rio RIO.Deque

    Push a new value to the end of the Deque

Page 275 of many | Previous | Next