packages feed

collect-errors 0.1.0.0 → 0.1.1.0

raw patch · 6 files changed

+25/−6 lines, 6 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Control.CollectErrors: removeValue :: Monoid es => CollectErrors es v -> es -> CollectErrors es v
+ Control.CollectErrors.Type: removeValue :: Monoid es => CollectErrors es v -> es -> CollectErrors es v
+ Numeric.CollectErrors: removeValue :: Monoid es => CollectErrors es v -> es -> CollectErrors es v
+ Numeric.CollectErrors: removeValueErrorCertain :: CN t -> NumError -> CN t
+ Numeric.CollectErrors: removeValueErrorPotential :: CN t -> NumError -> CN t
+ Numeric.CollectErrors.Type: removeValueErrorCertain :: CN t -> NumError -> CN t
+ Numeric.CollectErrors.Type: removeValueErrorPotential :: CN t -> NumError -> CN t

Files

ChangeLog.md view
@@ -1,8 +1,12 @@ # Changelog for collect-errors +## v0.1.1.0++* Add removeValue functions+ ## v0.1.0.0 -* Initial port of CollectErrors and CN from mixed-types-num-0.4.2+* Initial port of CollectErrors and CN from mixed-types-num-0.4.1  * Simplify the code by abandoning EnsureCE and related type functions and utilities 
collect-errors.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 7bf0425f189848e2370d0cab1f8335a5386e11e6f03271d1faafe460c97204ff+-- hash: 5f417d9a5348a4f9b717f189c1f3f9770e6a4a4acf3d3840841fbd82f9ac2ef0  name:           collect-errors-version:        0.1.0.0+version:        0.1.1.0 synopsis:       Error monad with a Float instance description:    Please see the README on GitHub at <https://github.com/michalkonecny/collect-errors#readme> category:       Math
src/Control/CollectErrors.hs view
@@ -7,6 +7,7 @@ , CanTestErrorsPresent(..) -- ** Utilities , noValue+, removeValue , prependErrors , unCollectErrors , (~!)
src/Control/CollectErrors/Type.hs view
@@ -64,6 +64,11 @@ noValue :: es -> CollectErrors es v noValue es = CollectErrors Nothing es +{-| Take a CE-value, add new errors into it and remove the value, if any -}+removeValue :: Monoid es => CollectErrors es v -> es -> CollectErrors es v+removeValue (CollectErrors _ es1) es2 =+  CollectErrors Nothing (es1 <> es2)+ prependErrors :: (Monoid es) => es -> CollectErrors es v -> CollectErrors es v prependErrors es1 (CollectErrors mv es2) = CollectErrors mv (es1 <> es2) 
src/Numeric/CollectErrors.hs view
@@ -4,11 +4,12 @@   NumError(..), ErrorCertaintyLevel(..), NumErrors, CN, cn, unCN, (~!)   -- * Utilities , noValueNumErrorCertain, noValueNumErrorPotential+, removeValueErrorCertain, removeValueErrorPotential+, prependErrorCertain, prependErrorPotential   -- ** Applicable general collect-error utilities , noValue+, removeValue , prependErrors-, prependErrorCertain-, prependErrorPotential , CanTestErrorsCertain(..) , CanTestErrorsPresent(..) , toEither
src/Numeric/CollectErrors/Type.hs view
@@ -9,7 +9,7 @@ import qualified Data.Set as Set  import Control.CollectErrors-    ( CanTestErrorsCertain(..), CollectErrors, noValue, prependErrors, liftCE, lift2CE, lift1TCE, liftT1CE, unCollectErrors, CanTestErrorsPresent )+    ( CanTestErrorsCertain(..), CollectErrors, noValue, removeValue, prependErrors, liftCE, lift2CE, lift1TCE, liftT1CE, unCollectErrors, CanTestErrorsPresent  )  cn :: v -> CN v cn = pure@@ -56,6 +56,14 @@ {-| Construct an empty wrapper indicating that given error may have occurred. -} noValueNumErrorPotential :: NumError -> CN v noValueNumErrorPotential e = noValue $ NumErrors $ Set.singleton (e, ErrorPotential)++removeValueErrorCertain :: CN t -> NumError -> CN t+removeValueErrorCertain v e = +  removeValue v $ NumErrors $ Set.singleton (e, ErrorCertain)++removeValueErrorPotential :: CN t -> NumError -> CN t+removeValueErrorPotential v e = +  removeValue v $ NumErrors $ Set.singleton (e, ErrorPotential)  prependErrorCertain :: NumError -> CN t -> CN t prependErrorCertain e = prependErrors $ NumErrors $ Set.singleton (e, ErrorCertain)