numtype-dk 0.5 → 0.5.0.1
raw patch · 5 files changed
+37/−16 lines, 5 filesdep ~base
Dependency ranges changed: base
Files
- Numeric/NumType/DK/Integers.hs +8/−9
- README +0/−4
- README.md +18/−0
- changelog.md +7/−0
- numtype-dk.cabal +4/−3
Numeric/NumType/DK/Integers.hs view
@@ -54,17 +54,16 @@ #if MIN_VERSION_base(4, 8, 0) -- Use @Nat@s from @GHC.TypeLits@. -import GHC.TypeLits hiding ((+)(), (*)(), (-)(), (^)()) -import qualified GHC.TypeLits as N +import qualified GHC.TypeLits as TN type Z = 0 -- GHC.TypeLits type N1 = 1 -- GHC.TypeLits #else -- Use custom @Typeable@ @Nat@s. -import Numeric.NumType.DK.Naturals (Nat (S, Z)) -import qualified Numeric.NumType.DK.Naturals as N +import qualified Numeric.NumType.DK.Naturals as TN -type N1 = 'S 'Z -- TypeInt.DK.Nats +type Z = 'TN.Z +type N1 = 'TN.S 'TN.Z -- TypeInt.DK.Nats #endif -- Use the same fixity for operators as the Prelude. @@ -76,14 +75,14 @@ -- Natural numbers -- =============== -type family NatPred (n::Nat) :: Nat where NatPred n = n N.- N1 -type family NatSucc (n::Nat) :: Nat where NatSucc n = n N.+ N1 +type family NatPred (n::TN.Nat) :: TN.Nat where NatPred n = n TN.- N1 +type family NatSucc (n::TN.Nat) :: TN.Nat where NatSucc n = n TN.+ N1 -- Integers -- ======== -data TypeInt = Neg10Minus Nat -- 10, 11, 12, 13, ... +data TypeInt = Neg10Minus TN.Nat -- 10, 11, 12, 13, ... | Neg9 | Neg8 | Neg7 @@ -103,7 +102,7 @@ | Pos7 | Pos8 | Pos9 - | Pos10Plus Nat -- -10, -11, -12, -13, ... + | Pos10Plus TN.Nat -- -10, -11, -12, -13, ... -- Unary operations
− README
@@ -1,4 +0,0 @@-Experimental. Requires GHC 7.8 or later. - -For project information (issues, updates, wiki, examples) see: - http://github.com/bjornbm/numtype-dk
+ README.md view
@@ -0,0 +1,18 @@+numtype-dk +========== + +This package provides type level representations of the integers +(`TypeInt`s) and basic operations (addition, subtraction, multiplication, +division, exponentiation) on these. + +Requires GHC 7.8 or later. + + +[](https://travis-ci.org/bjornbm/numtype-dk) +[](http://hackage.haskell.org/package/numtype-dk) + +Contributing +------------ + +For project information (code, issues) see: + http://github.com/bjornbm/numtype-dk
+ changelog.md view
@@ -0,0 +1,7 @@+0.5.0.1 (2016-05) +----------------- +Internal changes to support compilation on GHC 8.0.1 release candidate. + +0.5 (2015-05) +------------- +First public (Hackage) release.
numtype-dk.cabal view
@@ -1,8 +1,8 @@ name: numtype-dk -version: 0.5 +version: 0.5.0.1 license: BSD3 license-File: LICENSE -copyright: Bjorn Buckwalter 2012-2014 +copyright: Bjorn Buckwalter 2012-2015 author: Bjorn Buckwalter maintainer: bjorn@buckwalter.se category: Math @@ -24,7 +24,8 @@ Requires GHC 7.8 or later. -extra-source-files: README, +extra-source-files: README.md, + changelog.md Numeric/NumType/DKTests.hs source-repository head