mixed-types-num 0.5.0.4 → 0.5.1.0
raw patch · 3 files changed
+16/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Numeric.MixedTypes.Literals: instance (Numeric.MixedTypes.Literals.HasIfThenElse b t, Control.CollectErrors.Type.CanTakeErrors es (Numeric.MixedTypes.Literals.IfThenElseType b t), Control.CollectErrors.Type.CanBeErrors es) => Numeric.MixedTypes.Literals.HasIfThenElse (Control.CollectErrors.Type.CollectErrors es b) t
Files
- changelog.md +3/−0
- mixed-types-num.cabal +2/−2
- src/Numeric/MixedTypes/Literals.hs +11/−0
changelog.md view
@@ -1,5 +1,8 @@ # mixed-types-num change log +* v 0.5.1 2021-05-12+ * if-then-else for CN-wrapped (see collect-error) condition+ * Documentation now in README * v 0.5.0 2021-04-13 * use package collect-errors with a much simpler CN wrapper * replace Maybe Bool by Kleenean (a new type)
mixed-types-num.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 46e51b8b8646d27d08cfb89dbe49874f7b1f16bce6d62ac284c8d7b4a5b0d7f4+-- hash: ebf35143ac4aa16c68d0c397d0889437a815ea20e6e3ae5c9e7cf62648b7ea30 name: mixed-types-num-version: 0.5.0.4+version: 0.5.1.0 synopsis: Alternative Prelude with numeric and logic expressions typed bottom-up description: Please see the README on GitHub at <https://github.com/michalkonecny/mixed-types-num#readme> category: Math
src/Numeric/MixedTypes/Literals.hs view
@@ -107,6 +107,17 @@ | b = e1 | otherwise = e2 +instance + (HasIfThenElse b t, CanTakeErrors es (IfThenElseType b t), CanBeErrors es) + =>+ (HasIfThenElse (CollectErrors es b) t)+ where+ type IfThenElseType (CollectErrors es b) t = IfThenElseType b t+ ifThenElse (CollectErrors (Just b) es) e1 e2 = + takeErrors es $ ifThenElse b e1 e2+ ifThenElse (CollectErrors _ es) _ _ = + takeErrorsNoValue es+ _testIf1 :: String _testIf1 = if True then "yes" else "no"