blarney-0.1.0.0
Copyright(c) Alexandre Joannou 2020-2021
LicenseMIT
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageGHC2021

Blarney.Misc.MonadLoops

Description

This module provides monadic loop helpers non present in base. Inspired by Control.Monad.Loops

Synopsis

Documentation

untilPredM :: Monad m => m a -> (a -> Bool) -> m [a] infixr 0 Source #

Repeat computation until a predicate holds

untilPredM_ :: Monad m => m a -> (a -> Bool) -> m () infixr 0 Source #

Same as untilPredM but discard the final result

untilM :: Monad m => m a -> m Bool -> m [a] infixr 0 Source #

Repeat computation until the second monadic computation returns True

untilM_ :: Monad m => m a -> m Bool -> m () infixr 0 Source #

Same as untilM but discard the final result