almost-fix-0.0.2: Recurse while a predicate is satisfied
Data.Function.AlmostFix
Synopsis
almostFix :: (a -> Bool) -> (a -> a) -> a -> a Source
Applies the predicate to the input: almostFix (< 5) (+1) 0 = 4
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.