packages feed

mixed-types-num 0.5.3.1 → 0.5.4.0

raw patch · 6 files changed

+32/−119 lines, 6 files

Files

README.md view
@@ -167,7 +167,7 @@  ```Text ...> abs1 (pi - pi)-{?(prec 36): [0.000000000014551915228366851806640625 ± ~1.4552e-11 ~2^(-36)]}+{?(prec 36): [0.00000000001455191522836685... ± ~1.4552e-11 ~2^(-36)]} ```  ## 2. Type classes
changelog.md view
@@ -1,5 +1,7 @@ # mixed-types-num change log +* v 0.5.4 2021-05-21+  * remove Kleeneans (move them to aern2-mp) * v 0.5.3 2021-05-15   * export clearPotentialErrors (from collect-errors) * v 0.5.2 2021-05-14
mixed-types-num.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack ----- hash: b3d332f33d36e950209f8820746264e45a1f3d0bd008cb55be2781435d467986+-- hash: e8481fef82c6968e2cd9d5cd1e354653793e3030ec91c88a836dd8df6593752f  name:           mixed-types-num-version:        0.5.3.1+version:        0.5.4.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@@ -40,7 +40,6 @@       Numeric.MixedTypes.Elementary       Numeric.MixedTypes.Eq       Numeric.MixedTypes.Field-      Numeric.MixedTypes.Kleenean       Numeric.MixedTypes.Literals       Numeric.MixedTypes.MinMaxAbs       Numeric.MixedTypes.Ord@@ -56,8 +55,19 @@       Paths_mixed_types_num   hs-source-dirs:       src-  default-extensions: RebindableSyntax ScopedTypeVariables TypeFamilies TypeOperators ConstraintKinds DefaultSignatures MultiParamTypeClasses FlexibleContexts FlexibleInstances UndecidableInstances-  other-extensions: TemplateHaskell+  default-extensions:+      RebindableSyntax+      ScopedTypeVariables+      TypeFamilies+      TypeOperators+      ConstraintKinds+      DefaultSignatures+      MultiParamTypeClasses+      FlexibleContexts+      FlexibleInstances+      UndecidableInstances+  other-extensions:+      TemplateHaskell   ghc-options: -Wall   build-depends:       QuickCheck >=2.7@@ -85,8 +95,19 @@       Paths_mixed_types_num   hs-source-dirs:       test-  default-extensions: RebindableSyntax ScopedTypeVariables TypeFamilies TypeOperators ConstraintKinds DefaultSignatures MultiParamTypeClasses FlexibleContexts FlexibleInstances UndecidableInstances-  other-extensions: TemplateHaskell+  default-extensions:+      RebindableSyntax+      ScopedTypeVariables+      TypeFamilies+      TypeOperators+      ConstraintKinds+      DefaultSignatures+      MultiParamTypeClasses+      FlexibleContexts+      FlexibleInstances+      UndecidableInstances+  other-extensions:+      TemplateHaskell   ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall   build-depends:       QuickCheck >=2.7
src/MixedTypesNumPrelude.hs view
@@ -28,7 +28,6 @@   -- * Modules with Prelude alternatives   module Numeric.MixedTypes.Literals,   module Numeric.MixedTypes.Bool,-  module Numeric.MixedTypes.Kleenean,   module Numeric.MixedTypes.Eq,   module Numeric.MixedTypes.Ord,   module Numeric.MixedTypes.MinMaxAbs,@@ -58,7 +57,6 @@ import Numeric.MixedTypes.PreludeHiding import Numeric.MixedTypes.Literals import Numeric.MixedTypes.Bool-import Numeric.MixedTypes.Kleenean import Numeric.MixedTypes.Eq import Numeric.MixedTypes.Ord import Numeric.MixedTypes.MinMaxAbs
− src/Numeric/MixedTypes/Kleenean.hs
@@ -1,96 +0,0 @@-{-# OPTIONS_GHC -Wno-orphans #-}-{-# LANGUAGE DeriveGeneric #-}-{-|-    Module      :  Numeric.MixedType.Kleenean-    Description :  Three-valued logic-    Copyright   :  (c) Michal Konecny-    License     :  BSD3--    Maintainer  :  mikkonecny@gmail.com-    Stability   :  experimental-    Portability :  portable---}-module Numeric.MixedTypes.Kleenean-(-    Kleenean(..), kleenean, tKleenean-)-where--import Numeric.MixedTypes.PreludeHiding-import qualified Prelude as P--import Test.SmallCheck.Series-import GHC.Generics--import Numeric.MixedTypes.Literals-    ( ConvertibleExactly(..), convertExactly, T(T) )-import Numeric.MixedTypes.Bool-    ( (&&),-      not,-      CanAndOrAsymmetric(..),-      CanNeg(negate),-      CanTestCertainly(..),-      and )--tKleenean :: T Kleenean-tKleenean = T "Kleenean"--data Kleenean = CertainTrue | CertainFalse | TrueOrFalse-  deriving (P.Eq, Show, Generic)--instance Serial IO Kleenean--type CanBeKleenean t = ConvertibleExactly t Kleenean-kleenean :: (CanBeKleenean t) => t -> Kleenean-kleenean = convertExactly--instance ConvertibleExactly Kleenean Kleenean where-  safeConvertExactly = Right--instance ConvertibleExactly Bool Kleenean where-  safeConvertExactly True = Right CertainTrue-  safeConvertExactly False = Right CertainFalse--instance CanTestCertainly Kleenean where-  isCertainlyTrue = (P.== CertainTrue)-  isCertainlyFalse = (P.== CertainFalse)--instance CanNeg Kleenean where-  negate CertainTrue = CertainFalse-  negate CertainFalse = CertainTrue-  negate TrueOrFalse = TrueOrFalse--_testNeg1 :: Kleenean-_testNeg1 = not CertainTrue--instance CanAndOrAsymmetric Kleenean Kleenean-  where-  type AndOrType Kleenean Kleenean = Kleenean-  and2 CertainTrue CertainTrue = CertainTrue-  and2 CertainFalse _ = CertainFalse-  and2 _ CertainFalse = CertainFalse-  and2 _ _ = TrueOrFalse-  or2 CertainFalse CertainFalse = CertainFalse-  or2 CertainTrue _ = CertainTrue-  or2 _ CertainTrue = CertainTrue-  or2 _ _ = TrueOrFalse--instance CanAndOrAsymmetric Bool Kleenean-  where-  type AndOrType Bool Kleenean = Kleenean-  and2 b = and2 (kleenean b)-  or2 b = or2 (kleenean b)--instance CanAndOrAsymmetric Kleenean Bool-  where-  type AndOrType Kleenean Bool = Kleenean-  and2 k b = and2 k (kleenean b)-  or2 k b = or2 k (kleenean b)--_testAndOr1 :: Kleenean-_testAndOr1 = TrueOrFalse && False--_testAndOr2 :: Kleenean-_testAndOr2 = and [CertainTrue, TrueOrFalse, CertainFalse]-
test/Numeric/MixedTypes/BoolSpec.hs view
@@ -18,15 +18,3 @@ spec :: Spec spec = do   specIsBool tBool-  specIsBool tKleenean-  -- mixed-type tests:-  specCanAndOr tBool tKleenean tBool-  -- describe "mixed-type Boolean operation examples" $ do-  --   it "can do True || Nothing" $ do-  --     True || (Nothing :: Maybe Bool) `shouldBe` Just True-  --   it "can do Nothing || True" $ do-  --     (Nothing :: Maybe Bool) || True `shouldBe` Just True-  --   it "can do True || Just Nothing" $ do-  --     True || Just (Nothing :: Maybe Bool) `shouldBe` Just (Just True)-  --   it "can do Just Nothing || True" $ do-  --     Just (Nothing :: Maybe Bool) || True `shouldBe` Just (Just True)