almost-fix-0.0.0: Recurse until a predicate

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Function.AlmostFix

Synopsis

Documentation

almostFix :: (a -> Bool) -> (a -> a) -> a -> a Source

Applies the predicate to the input: almostFix (< 5) (+1) 0 =

almostFix' :: (a -> Bool) -> (a -> a) -> a -> a Source

Applies the predicate to the result.

almostFixM :: Monad m => m Bool -> (a -> m a) -> a -> m a Source

Use a monadic predicate for the control flow.