packages feed

almost-fix 0.0.1 → 0.0.2

raw patch · 2 files changed

+2/−7 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.Function.AlmostFix: almostFix' :: (a -> Bool) -> (a -> a) -> a -> a

Files

almost-fix.cabal view
@@ -1,5 +1,5 @@ Name:                   almost-fix-Version:                0.0.1+Version:                0.0.2 Author:                 Athan Clark <athan.clark@gmail.com> Maintainer:             Athan Clark <athan.clark@gmail.com> License:                BSD3
src/Data/Function/AlmostFix.hs view
@@ -4,15 +4,10 @@   -- | Applies the predicate to the input:--- @almostFix (< 5) (+1) 0  =  @+-- @almostFix (< 5) (+1) 0  =  4@ almostFix :: (a -> Bool) -> (a -> a) -> a -> a almostFix p f x = if p x then almostFix p f (f x)                          else x---- | Applies the predicate to the result.-almostFix' :: (a -> Bool) -> (a -> a) -> a -> a-almostFix' p f x = if p (f x) then almostFix' p f (f x)-                              else x  -- | Use a monadic predicate for the control flow. almostFixM :: Monad m => m Bool -> (a -> m a) -> a -> m a