HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduledeque-0.4.4.1Haskell2010

Deque.Strict.State

Strict Deque API lifted to a State monad, "mtl"-style.

  • 22 values
  • Packagedeque-0.4.4.1
  • Exports22
  • LanguageHaskell2010
  • LicenceMIT
  • SourceState.hs
valuemap :: MonadState (Deque a) m => (a -> a) -> m ()
#

\mathcal{O}(n). Modify each element of the queue.

valueshiftLeft :: MonadState (Deque a) m => m ()
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Move the first element to the end.

valueshiftRight :: MonadState (Deque a) m => m ()
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Move the last element to the beginning.

valuefilter :: MonadState (Deque a) m => (a -> Bool) -> m ()
#

\mathcal{O}(n). Leave only the elements satisfying the predicate.

valuetake :: MonadState (Deque a) m => Int -> m ()
#

\mathcal{O}(n). Leave only the specified amount of first elements.

valuedrop :: MonadState (Deque a) m => Int -> m ()
#

\mathcal{O}(n). Drop the specified amount of first elements.

valuespan :: MonadState (Deque a) m => (a -> Bool) -> m (Deque a)
#

\mathcal{O}(n). Return the first elements satisfying the predicate, removing them from the state.

valueuncons :: MonadState (Deque a) m => m (Maybe a)
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Get the first element if deque is not empty, removing the element.

valueunsnoc :: MonadState (Deque a) m => m (Maybe a)
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Get the last element if deque is not empty, removing the element.

valuehead :: MonadState (Deque a) m => m (Maybe a)
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Get the first element if deque is not empty.

valuelast :: MonadState (Deque a) m => m (Maybe a)
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Get the last element if deque is not empty.

valuetail :: MonadState (Deque a) m => m ()
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Keep all elements but the first one.

valueinit :: MonadState (Deque a) m => m ()
#

\mathcal{O}(1), occasionally \mathcal{O}(n). Keep all elements but the last one.