packages feed

numhask-prelude 0.3.1 → 0.3.2

raw patch · 3 files changed

+13/−11 lines, 3 filesdep −numhask-space

Dependencies removed: numhask-space

Files

numhask-prelude.cabal view
@@ -1,5 +1,5 @@ name: numhask-prelude-version: 0.3.1+version: 0.3.2 synopsis:   A numeric prelude description:@@ -48,7 +48,6 @@   build-depends:       base >=4.7 && <5     , numhask >=0.3 && <0.4-    , numhask-space >=0.1.1 && <0.2     , protolude >=0.1 && <0.3   exposed-modules:     NumHask.Prelude
src/NumHask/Examples.hs view
@@ -6,6 +6,7 @@ {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE RebindableSyntax #-} {-# OPTIONS_GHC -Wall #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}  -- | NumHask usage examples module NumHask.Examples@@ -28,12 +29,15 @@   ) where +import NumHask.Prelude+ -- $imports -- NumHask.Prelude is a replacement for the standard prelude with the 'NoImplicitPrelude' extension explicitly required. -- -- $setup -- >>> :set -XNoImplicitPrelude -- >>> :set -XFlexibleContexts+-- >>> :set -XRebindableSyntax -- >>> import NumHask.Prelude -- -- $basic@@ -45,6 +49,7 @@ -- 0 -- >>> 1 * 1 -- 1+-- -- >>> 1.0 / 1.0 -- 1.0 --@@ -55,11 +60,12 @@ -- ... No instance for (Divisive Int) ... -- ... ----- >>> 1.0 / fromIntegral (1::Int)+-- >>> 1.0 / fromInteger 1 -- 1.0 ----- RebindableSyntax removes the Haskell98 link between literal numbers and base classes.  Literal numbers are pre-processed by ghc as `fromInteger 1` and `fromRational 1.0`.+-- RebindableSyntax removes the Haskell98 link between literal numbers and prelude.  Literal numbers are pre-pended by ghc with `fromInteger` for integers and `fromRational` for decimals. --+-- >>> :set -XNoRebindableSyntax -- >>> :t 1 -- 1 :: Num p => p --@@ -71,7 +77,7 @@ -- 1 :: FromInteger a => a -- -- >>> :t 1.0--- 1.0 :: FromRatio b => b+-- 1.0 :: FromRational a => a -- -- 'Float' and 'Double' are 'NumHask.Algebra.Fields.Field' instances. --@@ -135,5 +141,6 @@ -- (-1) :+ (-2) -- >>> (1 :+ (-2)) * ((-2) :+ 4) -- 6 :+ 8+-- -- >>> (1.0 :+ (-1.0)) / (2.0 :+ 2.0) -- 0.0 :+ (-0.5)
src/NumHask/Prelude.hs view
@@ -31,10 +31,8 @@   , module NumHask.Algebra.Linear.Hadamard   , module NumHask.Analysis.Banach   , module NumHask.Analysis.Metric-  , module NumHask.Analysis.Space   , module NumHask.Data.Complex      , module NumHask.Data.Integral-  , module NumHask.Data.Range   , module NumHask.Data.LogField          , module NumHask.Data.Rational   , module NumHask.Data.Pair@@ -44,9 +42,9 @@   ) where   #if MIN_VERSION_base(4,11,0)-import Protolude hiding (Integral(..), Rep, Semiring(..), (*), (**), (+), (-), (/), (^), (^^), abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceiling, cos, cosh, exp, floor, fromInteger, fromIntegral, even, odd, infinity, log, logBase, negate, pi, product, properFraction, recip, round, sin, sinh, sqrt, sum, tan, tanh, toInteger, trans, truncate, zero, fromRational, Ratio(..), Rational, reduce, gcd, subtract, Complex(..), Sum(..), Product(..), isNaN, realPart, imagPart, polar, phase, mkPolar, magnitude, cis)+import Protolude hiding (Integral(..), Rep, Semiring(..), (*), (**), (+), (-), (/), (^), (^^), abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceiling, cos, cosh, exp, floor, fromInteger, fromIntegral, even, odd, infinity, log, logBase, negate, pi, product, properFraction, recip, round, sin, sinh, sqrt, sum, tan, tanh, toInteger, trans, truncate, zero, fromRational, Ratio(..), reduce, gcd, subtract, Complex(..), Sum(..), Product(..), realPart, imagPart, polar, phase, mkPolar, magnitude, cis, toRational) #else-import Protolude hiding (Integral(..), Rep, Semiring(..), (*), (**), (+), (-), (/), (^), (^^), abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceiling, cos, cosh, exp, floor, fromInteger, fromIntegral, even, odd, infinity, log, logBase, negate, pi, product, properFraction, recip, round, sin, sinh, sqrt, sum, tan, tanh, toInteger, trans, truncate, zero, fromRational, Ratio(..), Rational, reduce, gcd, subtract, Complex(..), Sum(..), Product(..), isNaN, realPart, imagPart, polar, phase, mkPolar, magnitude, cis, (<>), Semigroup)+import Protolude hiding (Integral(..), Rep, Semiring(..), (*), (**), (+), (-), (/), (^), (^^), abs, acos, acosh, asin, asinh, atan, atan2, atanh, ceiling, cos, cosh, exp, floor, fromInteger, fromIntegral, even, odd, infinity, log, logBase, negate, pi, product, properFraction, recip, round, sin, sinh, sqrt, sum, tan, tanh, toInteger, trans, truncate, zero, fromRational, Ratio(..), reduce, gcd, subtract, Complex(..), Sum(..), Product(..), realPart, imagPart, polar, phase, mkPolar, magnitude, cis, toRational, (<>), Semigroup) import Data.Semigroup ((<>), Semigroup) #endif @@ -66,10 +64,8 @@ import NumHask.Algebra.Linear.Hadamard import NumHask.Analysis.Banach import NumHask.Analysis.Metric-import NumHask.Analysis.Space import NumHask.Data.Complex import NumHask.Data.Integral-import NumHask.Data.Range import NumHask.Data.LogField import NumHask.Data.Pair import NumHask.Data.Positive