packages feed

mixed-types-num 0.5.1.0 → 0.5.2.0

raw patch · 3 files changed

+81/−2 lines, 3 files

Files

changelog.md view
@@ -1,5 +1,7 @@ # mixed-types-num change log +* v 0.5.1 2021-05-14+  * add OrdGenericBool * v 0.5.1 2021-05-12   * if-then-else for CN-wrapped (see collect-error) condition   * Documentation now in README
mixed-types-num.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: ebf35143ac4aa16c68d0c397d0889437a815ea20e6e3ae5c9e7cf62648b7ea30+-- hash: fb5bb6100cd056ab9cf27256821a3654757d1aa586135f51cad76052f44a8068  name:           mixed-types-num-version:        0.5.1.0+version:        0.5.2.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@@ -49,6 +49,7 @@       Numeric.MixedTypes.Reduce       Numeric.MixedTypes.Ring       Numeric.MixedTypes.Round+      Numeric.OrdGenericBool       Utils.Test.EnforceRange       Utils.TH.DeclForTypes   other-modules:
+ src/Numeric/OrdGenericBool.hs view
@@ -0,0 +1,76 @@+{-|+    Module      :  Numeric.OrdGenericBool+    Description :  Order with generic Bool-like type+    Copyright   :  (c) Michal Konecny+    License     :  BSD3++    Maintainer  :  mikkonecny@gmail.com+    Stability   :  experimental+    Portability :  portable++    Order ops with generic return type.  +    +    Originally developed for semi-decidable comparisons that return Kleenean instead of Bool.+    +    Use in combination with:++    import Prelude hiding ((==),(/=),(<),(<=),(>),(>=),abs,max,min,not,(&&),(||))+    import qualified Prelude as P++    The usual comparison operators are still available using the P prefix.+-}+module Numeric.OrdGenericBool+(+    -- * order operators+    (==), (/=), (<), (<=), (>), (>=), abs, max, min,+    -- * logical operators+    not, (&&), (||)+)+where++import Prelude hiding ((==),(/=),(<),(<=),(>),(>=),abs,max,min,not,(&&),(||))++import qualified MixedTypesNumPrelude as M++infix  4  ==, /=++(==) :: (M.HasEqAsymmetric t t) => t -> t -> (M.EqCompareType t t)+(==) = (M.==)++(/=) :: (M.HasEqAsymmetric t t) => t -> t -> (M.EqCompareType t t)+(/=) = (M./=)++infix  4  <, <=, >=, >++(<) :: (M.HasOrderAsymmetric t t) => t -> t -> (M.OrderCompareType t t)+(<) = (M.<)++(<=) :: (M.HasOrderAsymmetric t t) => t -> t -> (M.OrderCompareType t t)+(<=) = (M.<=)++(>) :: (M.HasOrderAsymmetric t t) => t -> t -> (M.OrderCompareType t t)+(>) = (M.>)++(>=) :: (M.HasOrderAsymmetric t t) => t -> t -> (M.OrderCompareType t t)+(>=) = (M.>=)++abs :: (M.CanAbsSameType t) => t -> t+abs = (M.abs)++max :: (M.CanMinMaxSameType t) => t -> t -> t+max = (M.max)++min :: (M.CanMinMaxSameType t) => t -> t -> t+min = (M.min)++infixr 3  &&+infixr 2  ||++(&&) :: (M.CanAndOrSameType t) => t -> t -> t+(&&) = (M.&&)++(||) :: (M.CanAndOrSameType t) => t -> t -> t+(||) = (M.||)++not :: (M.CanNegSameType t) => t -> t+not = M.not