concrete-typerep 0.1.0.1 → 0.1.0.2
raw patch · 2 files changed
+9/−10 lines, 2 filesdep ~basedep ~hashablePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, hashable
API changes (from Hackage documentation)
Files
- Data/ConcreteTypeRep.hs +5/−5
- concrete-typerep.cabal +4/−5
Data/ConcreteTypeRep.hs view
@@ -35,7 +35,7 @@ import Control.Applicative((<$>)) --- | Abstract type providing the functionality of 'TypeRep', but additionally supporting hashing and serialization. +-- | Abstract type providing the functionality of 'TypeRep', but additionally supporting hashing and serialization. -- -- The 'Eq' instance is just the 'Eq' instance for 'TypeRep', so an analogous guarantee holds: @'cTypeOf' a == 'cTypeOf' b@ if and only if @a@ and @b@ have the same type. -- The hashing and serialization functions preserve this equality.@@ -57,13 +57,13 @@ instance Show ConcreteTypeRep where showsPrec i = showsPrec i . unCTR - + -- | This instance is guaranteed to be consistent for a single run of the program, but not for multiple runs. instance Hashable ConcreteTypeRep where #ifdef NEW_TYPEREP- hash (CTR (TypeRep (Fingerprint w1 w2) _ _)) = hash (w1, w2)+ hashWithSalt salt (CTR (TypeRep (Fingerprint w1 w2) _ _)) = salt `hashWithSalt` w1 `hashWithSalt` w2 #else- hash = unsafePerformIO . typeRepKey . toTypeRep+ hashWithSalt salt ctr = hashWithSalt salt (unsafePerformIO . typeRepKey . toTypeRep $ ctr) #endif ------------- serialization: this uses Gökhan San's construction, from@@ -83,7 +83,7 @@ newtype SerialRep = SR (TyConRep, [SerialRep]) deriving(Binary) toSerial :: ConcreteTypeRep -> SerialRep-toSerial (CTR t) = +toSerial (CTR t) = case splitTyConApp t of (con, args) -> SR (toTyConRep con, map (toSerial . CTR) args)
concrete-typerep.cabal view
@@ -1,5 +1,5 @@ Name: concrete-typerep-Version: 0.1.0.1+Version: 0.1.0.2 Synopsis: Binary and Hashable instances for TypeRep Description: Binary and Hashable instances for TypeRep License: BSD3@@ -17,7 +17,7 @@ Library Exposed-modules: Data.ConcreteTypeRep - Build-depends: binary, hashable+ Build-depends: binary, hashable < 1.3 if flag(new-typerep) Build-depends: base >= 4.4 && < 5, ghc >= 7.2@@ -29,7 +29,7 @@ type: exitcode-stdio-1.0 Main-is: Main.hs hs-source-dirs: tests- build-depends: + build-depends: base, binary, concrete-typerep,@@ -37,5 +37,4 @@ test-framework, test-framework-quickcheck2, QuickCheck >= 2.4- - +