int-cast 0.1.0.0 → 0.1.1.0
raw patch · 3 files changed
+23/−11 lines, 3 filesdep +QuickCheckdep +natsPVP ok
version bump matches the API change (PVP)
Dependencies added: QuickCheck, nats
API changes (from Hackage documentation)
Files
- Data/IntCast.hs +7/−8
- changelog.md +11/−0
- int-cast.cabal +5/−3
Data/IntCast.hs view
@@ -57,6 +57,7 @@ -- non-Haskell 2010 import GHC.TypeLits import Data.Bits+import Data.Type.Equality -- | (Kind) Meta-information about integral types. --@@ -164,22 +165,20 @@ -- Same bit-size predicate type family IsIntBaseTypeIso a b :: Bool where- IsIntBaseTypeIso (FixedIntTag n) (FixedIntTag n) = True+ IsIntBaseTypeIso a a = True IsIntBaseTypeIso (FixedIntTag n) (FixedWordTag n) = True IsIntBaseTypeIso (FixedWordTag n) (FixedIntTag n) = True- IsIntBaseTypeIso (FixedWordTag n) (FixedWordTag n) = True IsIntBaseTypeIso a b = False type IsIntTypeIso a b = IsIntBaseTypeIso (IntBaseType a) (IntBaseType b) -type family IsIntBaseTypeEq a b :: Bool where- IsIntBaseTypeEq (FixedIntTag n) (FixedIntTag n) = True- IsIntBaseTypeEq (FixedWordTag n) (FixedWordTag n) = True- IsIntBaseTypeEq BigIntTag BigIntTag = True- IsIntBaseTypeEq BigWordTag BigWordTag = True- IsIntBaseTypeEq a b = False+type family IsIntBaseTypeEq (a :: IntBaseTypeK) (b :: IntBaseTypeK) :: Bool where+ IsIntBaseTypeEq a a = True+ IsIntBaseTypeEq a b = False type IsIntTypeEq a b = IsIntBaseTypeEq (IntBaseType a) (IntBaseType b)++type instance a == b = IsIntBaseTypeEq a b -- | Statically checked integer conversion which satisfies the property --
+ changelog.md view
@@ -0,0 +1,11 @@+## 0.1.1.0++ * Fix `intCastIso` to be reflexive wrt non-fixed integer types++ * Simplified `IsIntBaseTypeEq` equations++ * Add `Data.Type.Equality.(==)` instance for `IntBaseTypeK`++## 0.1.0.0++ * initial release
int-cast.cabal view
@@ -1,5 +1,5 @@ name: int-cast-version: 0.1.0.0+version: 0.1.1.0 synopsis: Checked conversions between integral types homepage: https://github.com/hvr/int-cast bug-reports: https://github.com/hvr/int-cast/issues@@ -13,6 +13,8 @@ description: Provides statically or dynamically checked conversions between integral types. +extra-source-files: changelog.md+ source-repository head type: git location: https://github.com/hvr/int-cast.git@@ -20,7 +22,7 @@ source-repository this type: git location: https://github.com/hvr/int-cast.git- tag: 0.1.0.0+ tag: 0.1.1.0 library default-language: Haskell2010@@ -39,4 +41,4 @@ hs-source-dirs: test . main-is: Suite.hs ghc-options: -Wall- build-depends: int-cast, base, test-framework ==0.8.*, test-framework-quickcheck2 ==0.3.*+ build-depends: int-cast, base, QuickCheck ==2.6.*, test-framework ==0.8.*, test-framework-quickcheck2 ==0.3.*, nats ==0.1.*