Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- almostFix :: (a -> Bool) -> (a -> a) -> a -> a
- almostFix' :: (a -> Bool) -> (a -> a) -> a -> a
- almostFixM :: Monad m => m Bool -> (a -> m a) -> a -> m a

# 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.