HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduledeferred-folds-0.9.18.6Haskell2010

DeferredFolds.UnfoldlM

  • 1 type
  • 19 values
newtypenewtype UnfoldlM (m :: Type -> Type) a
#

A monadic variation of DeferredFolds.Unfoldl

Constructors

  • UnfoldlM (forall x. (x -> a -> m x) -> x -> m x)
Instances13MonadTrans, Monad, Functor, Applicative, Foldable, Alternative, …
valuemapM_ :: Monad m => (input -> m ()) -> UnfoldlM m input -> m ()
#

A more efficient implementation of mapM_

valuefoldlM'
  1. :: Monad m
  2. => output -> input -> m output
  3. -> output
  4. -> UnfoldlM m input
  5. -> m output
#

Perform a monadic strict left fold

valuefoldlRunner
  1. :: Monad m
  2. => forall x. (x -> a -> x) -> x -> x
  3. -> UnfoldlM m a
#

Construct from a specification of how to execute a left-fold

valuefoldrRunner
  1. :: Monad m
  2. => forall x. (a -> x -> x) -> x -> x
  3. -> UnfoldlM m a
#

Construct from a specification of how to execute a right-fold

valuehoist
  1. :: forall a1. m a1 -> n a1
  2. -> forall a1. n a1 -> m a1
  3. -> UnfoldlM m a
  4. -> UnfoldlM n a
#

Change the base monad using invariant natural transformations