cond 0.4.1 → 0.4.1.1
raw patch · 3 files changed
+5/−5 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Algebra.Boolean: instance Typeable1 Bitwise
+ Data.Algebra.Boolean: instance Typeable Bitwise
- Control.Conditional: unless :: (Boolean bool, ToBool bool, MonadPlus m) => bool -> m () -> m ()
+ Control.Conditional: unless :: (Boolean bool, ToBool bool, Monad m) => bool -> m () -> m ()
- Control.Conditional: when :: (ToBool bool, MonadPlus m) => bool -> m () -> m ()
+ Control.Conditional: when :: (ToBool bool, Monad m) => bool -> m () -> m ()
- Data.Algebra.Boolean: class Boolean b where nand = not . and nor = not . or true = not false false = not true not = (<--> false) x && y = not (x || y) x || y = not (x && y) x xor y = (x || y) && (not (x && y)) x --> y = not x || y x <--> y = (x && y) || not (x || y) and = foldl' (&&) true or = foldl' (||) false all p = foldl' f true where f a b = a && p b any p = foldl' f false where f a b = a || p b
+ Data.Algebra.Boolean: class Boolean b where nand = not . and nor = not . or true = not false false = not true not = (<--> false) x && y = not (not x || not y) x || y = not (not x && not y) x `xor` y = (x || y) && (not (x && y)) x --> y = not x || y x <--> y = (x && y) || not (x || y) and = foldl' (&&) true or = foldl' (||) false all p = foldl' f true where f a b = a && p b any p = foldl' f false where f a b = a || p b
Files
- cond.cabal +1/−1
- src/Control/Conditional.hs +2/−2
- src/Data/Algebra/Boolean.hs +2/−2
cond.cabal view
@@ -1,5 +1,5 @@ Name: cond-Version: 0.4.1+Version: 0.4.1.1 Synopsis: Basic conditional and boolean operators with monadic variants. Category: Control, Logic, Monad License: BSD3
src/Control/Conditional.hs view
@@ -194,12 +194,12 @@ {-# INLINE guard #-} -- |Generalization of 'Control.Monad.when'-when :: (ToBool bool, MonadPlus m) => bool -> m () -> m ()+when :: (ToBool bool, Monad m) => bool -> m () -> m () when p m = if' p m (return ()) {-# INLINE when #-} -- |Generalization of 'Control.Monad.unless'-unless :: (Boolean bool, ToBool bool, MonadPlus m) => bool -> m() -> m()+unless :: (Boolean bool, ToBool bool, Monad m) => bool -> m() -> m() unless p m = if' (not p) m (return ()) {-# INLINE unless #-}
src/Data/Algebra/Boolean.hs view
@@ -72,8 +72,8 @@ true = not false false = not true not = (<--> false)- x && y = not (x || y)- x || y = not (x && y)+ x && y = not (not x || not y)+ x || y = not (not x && not y) x `xor` y = (x || y) && (not (x && y)) x --> y = not x || y x <--> y = (x && y) || not (x || y)