almost-fix-0.0.2: Recurse while a predicate is satisfied

Safe HaskellSafe
LanguageHaskell2010

Data.Function.AlmostFix

Synopsis

Documentation

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

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

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

Use a monadic predicate for the control flow.