deepseq-generics 0.1.1.2 → 0.2.0.0
raw patch · 4 files changed
+47/−51 lines, 4 filesdep ~HUnitdep ~basedep ~deepseqPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: HUnit, base, deepseq, ghc-prim, test-framework, test-framework-hunit
API changes (from Hackage documentation)
- Control.DeepSeq.Generics: ($!!) :: NFData a => (a -> b) -> a -> b
- Control.DeepSeq.Generics: class NFData a
- Control.DeepSeq.Generics: deepseq :: NFData a => a -> b -> b
- Control.DeepSeq.Generics: force :: NFData a => a -> a
- Control.DeepSeq.Generics: instance (GNFData a, GNFData b) => GNFData (a :*: b)
- Control.DeepSeq.Generics: instance (GNFData a, GNFData b) => GNFData (a :+: b)
- Control.DeepSeq.Generics: instance (GNFDataV1 a, GNFDataV1 b) => GNFDataV1 (a :*: b)
- Control.DeepSeq.Generics: instance (GNFDataV1 a, GNFDataV1 b) => GNFDataV1 (a :+: b)
- Control.DeepSeq.Generics: instance GNFData U1
- Control.DeepSeq.Generics: instance GNFData a => GNFData (M1 i c a)
- Control.DeepSeq.Generics: instance GNFDataV1 U1
- Control.DeepSeq.Generics: instance GNFDataV1 V1
- Control.DeepSeq.Generics: instance GNFDataV1 a => GNFDataV1 (M1 i c a)
- Control.DeepSeq.Generics: instance NFData a => GNFData (K1 i a)
- Control.DeepSeq.Generics: instance NFData a => GNFDataV1 (K1 i a)
- Control.DeepSeq.Generics: rnf :: NFData a => a -> ()
+ Control.DeepSeq.Generics: instance (Control.DeepSeq.Generics.GNFData a, Control.DeepSeq.Generics.GNFData b) => Control.DeepSeq.Generics.GNFData (a GHC.Generics.:*: b)
+ Control.DeepSeq.Generics: instance (Control.DeepSeq.Generics.GNFData a, Control.DeepSeq.Generics.GNFData b) => Control.DeepSeq.Generics.GNFData (a GHC.Generics.:+: b)
+ Control.DeepSeq.Generics: instance (Control.DeepSeq.Generics.GNFDataV1 a, Control.DeepSeq.Generics.GNFDataV1 b) => Control.DeepSeq.Generics.GNFDataV1 (a GHC.Generics.:*: b)
+ Control.DeepSeq.Generics: instance (Control.DeepSeq.Generics.GNFDataV1 a, Control.DeepSeq.Generics.GNFDataV1 b) => Control.DeepSeq.Generics.GNFDataV1 (a GHC.Generics.:+: b)
+ Control.DeepSeq.Generics: instance Control.DeepSeq.Generics.GNFData GHC.Generics.U1
+ Control.DeepSeq.Generics: instance Control.DeepSeq.Generics.GNFData a => Control.DeepSeq.Generics.GNFData (GHC.Generics.M1 i c a)
+ Control.DeepSeq.Generics: instance Control.DeepSeq.Generics.GNFDataV1 GHC.Generics.U1
+ Control.DeepSeq.Generics: instance Control.DeepSeq.Generics.GNFDataV1 GHC.Generics.V1
+ Control.DeepSeq.Generics: instance Control.DeepSeq.Generics.GNFDataV1 a => Control.DeepSeq.Generics.GNFDataV1 (GHC.Generics.M1 i c a)
+ Control.DeepSeq.Generics: instance Control.DeepSeq.NFData a => Control.DeepSeq.Generics.GNFData (GHC.Generics.K1 i a)
+ Control.DeepSeq.Generics: instance Control.DeepSeq.NFData a => Control.DeepSeq.Generics.GNFDataV1 (GHC.Generics.K1 i a)
Files
- Control/DeepSeq/Generics.hs +20/−28
- changelog +0/−17
- changelog.md +21/−0
- deepseq-generics.cabal +6/−6
Control/DeepSeq/Generics.hs view
@@ -9,12 +9,6 @@ -- Stability: stable -- Portability: GHC ----- Beyond the primary scope of providing the 'genericRnf' helper, this--- module also re-exports the definitions from "Control.DeepSeq" for--- convenience. If this poses any problems, just use qualified or--- explicit import statements (see code usage example in the--- 'genericRnf' description)--- -- __NOTE__: Starting with @deepseq-1.4.0.0@, 'NFData' gained support -- for generic derivation via @DefaultSignatures@. The new default -- 'rnf' method implementation is then equivalent to@@ -30,11 +24,6 @@ module Control.DeepSeq.Generics ( genericRnf , genericRnfV1- -- * "Control.DeepSeq" re-exports- , deepseq- , force- , NFData(rnf)- , ($!!) ) where import Control.DeepSeq@@ -82,7 +71,7 @@ -- > instance NFData a => NFData (Bar a) where rnf = genericRnf -- -- __NOTE__: The 'GNFData' type-class showing up in the type-signature is--- used internally and not exported on purpose currently.+-- used internally and not exported. genericRnf :: (Generic a, GNFData (Rep a)) => a -> () genericRnf = grnf_ . from@@ -97,26 +86,24 @@ grnf_ :: f a -> () instance GNFData U1 where- grnf_ !U1 = ()- {-# INLINE grnf_ #-}+ grnf_ U1 = () instance NFData a => GNFData (K1 i a) where grnf_ = rnf . unK1- {-# INLINE grnf_ #-}+ {-# INLINEABLE grnf_ #-} instance GNFData a => GNFData (M1 i c a) where grnf_ = grnf_ . unM1- {-# INLINE grnf_ #-}+ {-# INLINEABLE grnf_ #-} instance (GNFData a, GNFData b) => GNFData (a :*: b) where grnf_ (x :*: y) = grnf_ x `seq` grnf_ y- {-# INLINE grnf_ #-}+ {-# INLINEABLE grnf_ #-} instance (GNFData a, GNFData b) => GNFData (a :+: b) where grnf_ (L1 x) = grnf_ x grnf_ (R1 x) = grnf_ x- {-# INLINE grnf_ #-}-+ {-# INLINEABLE grnf_ #-} -- | Variant of 'genericRnf' which supports derivation for uninhabited types. --@@ -136,9 +123,15 @@ -- > In an equation for `it': it = genericRnf (undefined :: TagFoo) -- > -- > Prelude> genericRnfV1 (undefined :: TagFoo)--- > *** Exception: Control.DeepSeq.Generics.genericRnfV1: NF not defined for uninhabited types+-- > *** Exception: Control.DeepSeq.Generics.genericRnfV1: uninhabited type ----- /Since: 0.1.1.0/+-- 'genericRnfV1' corresponds to @deepseq-1.4.0.0@'s default @rnf@+-- method implementation.+--+-- __NOTE__: The 'GNFDataV1' type-class showing up in the type-signature is+-- used internally and not exported.+--+-- @since 0.1.1.0 genericRnfV1 :: (Generic a, GNFDataV1 (Rep a)) => a -> () genericRnfV1 = grnfV1_ . from {-# INLINE genericRnfV1 #-}@@ -148,25 +141,24 @@ grnfV1_ :: f a -> () instance GNFDataV1 V1 where- grnfV1_ = error "Control.DeepSeq.Generics.genericRnfV1: NF not defined for uninhabited types"+ grnfV1_ = error "Control.DeepSeq.Generics.genericRnfV1: uninhabited type" instance GNFDataV1 U1 where- grnfV1_ !U1 = ()- {-# INLINE grnfV1_ #-}+ grnfV1_ U1 = () instance NFData a => GNFDataV1 (K1 i a) where grnfV1_ = rnf . unK1- {-# INLINE grnfV1_ #-}+ {-# INLINEABLE grnfV1_ #-} instance GNFDataV1 a => GNFDataV1 (M1 i c a) where grnfV1_ = grnfV1_ . unM1- {-# INLINE grnfV1_ #-}+ {-# INLINEABLE grnfV1_ #-} instance (GNFDataV1 a, GNFDataV1 b) => GNFDataV1 (a :*: b) where grnfV1_ (x :*: y) = grnfV1_ x `seq` grnfV1_ y- {-# INLINE grnfV1_ #-}+ {-# INLINEABLE grnfV1_ #-} instance (GNFDataV1 a, GNFDataV1 b) => GNFDataV1 (a :+: b) where grnfV1_ (L1 x) = grnfV1_ x grnfV1_ (R1 x) = grnfV1_ x- {-# INLINE grnfV1_ #-}+ {-# INLINEABLE grnfV1_ #-}
− changelog
@@ -1,17 +0,0 @@--*-change-log-*---0.1.1.2 Herbert Valerio Riedel <hvr@gnu.org> November 2013-- * Add support for GHC 7.10 and `deepseq-1.4.0.0`--0.1.1.1 Herbert Valerio Riedel <hvr@gnu.org> November 2013-- * Add support for GHC 7.8--0.1.1.0 Herbert Valerio Riedel <hvr@gnu.org> September 2013-- * Control/DeepSeq/Generics.hs (genericRnfV1): New Function--0.1.0.0 Herbert Valerio Riedel <hvr@gnu.org> September 2012-- * Initial Release
+ changelog.md view
@@ -0,0 +1,21 @@+## 0.2.0.0 January 2016++ * Add support for GHC 8.0+ * Remove re-exports from `deepseq:Control.DeepSeq`+ * Synchronise implementation to `deepseq-1.4.0.0`'s code++## 0.1.1.2 December 2014++ * Add support for GHC 7.10 and `deepseq-1.4.0.0`++## 0.1.1.1 November 2013++ * Add support for GHC 7.8++## 0.1.1.0 September 2013++ * New Function `Control.DeepSeq.Generics.genericRnfV1`++## 0.1.0.0 September 2012++ * Initial Release
deepseq-generics.cabal view
@@ -1,5 +1,5 @@ name: deepseq-generics-version: 0.1.1.2+version: 0.2.0.0 synopsis: GHC.Generics-based Control.DeepSeq.rnf implementation homepage: https://github.com/hvr/deepseq-generics bug-reports: https://github.com/hvr/deepseq-generics/issues@@ -11,7 +11,7 @@ category: Control build-type: Simple cabal-version: >=1.10-tested-with: GHC==7.6.3, GHC==7.6.2, GHC==7.6.1, GHC==7.4.2, GHC==7.4.1+tested-with: GHC==8.0.*, GHC==7.10.*, GHC==7.8.*, GHC==7.6.*, GHC==7.4.* description: This package provides a "GHC.Generics"-based 'Control.DeepSeq.Generics.genericRnf' function which can be used@@ -26,14 +26,14 @@ This package differs from the @generic-deepseq@ package by working in combination with the existing @deepseq@ package as opposed to defining a conflicting drop-in replacement for @deepseq@'s- @Control.Deepseq@ module.+ @Control.DeepSeq@ module. .- Note: The ability to auto-derive via "GHC.Generics" has been+ __Note__: The ability to auto-derive via "GHC.Generics" has been merged into @deepseq-1.4.0.0@. This package is now still useful for writing code that's also compatible with older @deepseq@ versions not yet providing "GHC.Generics"-support. -extra-source-files: changelog+extra-source-files: changelog.md source-repository head type: git@@ -42,7 +42,7 @@ library default-language: Haskell2010 exposed-modules: Control.DeepSeq.Generics- build-depends: base >= 4.5 && < 4.9, ghc-prim >= 0.2 && < 0.4, deepseq >= 1.2.0.1 && < 1.5+ build-depends: base >= 4.5 && < 4.10, ghc-prim >= 0.2 && < 0.6, deepseq >= 1.2.0.1 && < 1.5 other-extensions: BangPatterns, FlexibleContexts, TypeOperators ghc-options: -Wall