HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduledeque-0.4.4.4Haskell2010

Deque.Strict.State

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

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

O(n). Modify each element of the queue.

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

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

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

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

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

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

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

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

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

O(1), occasionally O(n). Keep all elements but the first one.

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

O(1), occasionally O(n). Keep all elements but the last one.