packages feed

instant-deepseq 0.1.0.1 → 0.2

raw patch · 3 files changed

+50/−28 lines, 3 filesdep ~basedep ~deepseqPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, deepseq

API changes (from Hackage documentation)

- Generics.Instant.Functions.DeepSeq: instance (Generics.Instant.Functions.DeepSeq.GNFData a, Generics.Instant.Functions.DeepSeq.GNFData b) => Generics.Instant.Functions.DeepSeq.GNFData (a Generics.Instant.Base.:*: b)
- Generics.Instant.Functions.DeepSeq: instance (Generics.Instant.Functions.DeepSeq.GNFData a, Generics.Instant.Functions.DeepSeq.GNFData b) => Generics.Instant.Functions.DeepSeq.GNFData (a Generics.Instant.Base.:+: b)
- Generics.Instant.Functions.DeepSeq: instance Control.DeepSeq.NFData a => Generics.Instant.Functions.DeepSeq.GNFData (Generics.Instant.Base.Rec a)
- Generics.Instant.Functions.DeepSeq: instance Control.DeepSeq.NFData a => Generics.Instant.Functions.DeepSeq.GNFData (Generics.Instant.Base.Var a)
- Generics.Instant.Functions.DeepSeq: instance Generics.Instant.Functions.DeepSeq.GNFData Generics.Instant.Base.U
- Generics.Instant.Functions.DeepSeq: instance Generics.Instant.Functions.DeepSeq.GNFData Generics.Instant.Base.Z
- Generics.Instant.Functions.DeepSeq: instance forall (k :: BOX) (k1 :: BOX) (c :: k) (p :: k1) (q :: k1) a. Generics.Instant.Functions.DeepSeq.GNFData a => Generics.Instant.Functions.DeepSeq.GNFData (Generics.Instant.Base.CEq c p q a)
+ Generics.Instant.Functions.DeepSeq: class (Representable a, GNFData (Rep a)) => RepGNFData a
+ Generics.Instant.Functions.DeepSeq: grnfDefault :: (Representable a, GNFData (Rep a)) => a -> ()
+ Generics.Instant.Functions.DeepSeq: instance (GNFData a, GNFData b) => GNFData (a :*: b)
+ Generics.Instant.Functions.DeepSeq: instance (GNFData a, GNFData b) => GNFData (a :+: b)
+ Generics.Instant.Functions.DeepSeq: instance (Representable a, GNFData (Rep a)) => RepGNFData a
+ Generics.Instant.Functions.DeepSeq: instance GNFData U
+ Generics.Instant.Functions.DeepSeq: instance GNFData Z
+ Generics.Instant.Functions.DeepSeq: instance GNFData a => GNFData (CEq c p q a)
+ Generics.Instant.Functions.DeepSeq: instance NFData a => GNFData (Rec a)
+ Generics.Instant.Functions.DeepSeq: instance NFData a => GNFData (Var a)
- Generics.Instant.Functions.DeepSeq: grnf :: (Representable a, GNFData (Rep a)) => a -> ()
+ Generics.Instant.Functions.DeepSeq: grnf :: GNFData a => a -> ()

Files

CHANGELOG.md view
@@ -1,3 +1,14 @@+# Version 0.2++* Rename 'grnf' to 'grnfDefault'.++* Export 'RepGNFData'++* Export 'GNFData' internals.++* Relax dependencies.++ # Version 0.1.0.1  * Raise upper bound on `instant-generics` dependency.
instant-deepseq.cabal view
@@ -1,11 +1,14 @@ name:                instant-deepseq-version:             0.1.0.1+version:             0.2 author:              Renzo Carbonara maintainer:          renzo@carbonara.com.ar copyright:           Renzo Carbonara 2015 license:             BSD3 license-file:        LICENSE.txt-category:            Web+stability:           Experimental+homepage:            https://github.com/k0001/instant-deepseq+bug-reports:         https://github.com/k0001/instant-deepseq/issues+category:            Generics build-type:          Simple extra-source-files:  README.md CHANGELOG.md cabal-version:       >=1.18@@ -17,8 +20,8 @@   exposed-modules:       Generics.Instant.Functions.DeepSeq   build-depends:-      deepseq >=1.4 && <1.5-    , base >=4.8 && <4.9+      deepseq >=1.3 && <1.5+    , base >=4.7 && <4.9     , instant-generics >=0.4 && <0.6   ghcjs-options: -Wall -O3   ghc-options: -Wall -O2
src/lib/Generics/Instant/Functions/DeepSeq.hs view
@@ -4,12 +4,14 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE PolyKinds #-}+{-# LANGUAGE UndecidableInstances #-}  module Generics.Instant.Functions.DeepSeq   ( -- $defaults-    grnf+    grnfDefault+  , RepGNFData     -- * Internals-  , GNFData+  , GNFData(..)   ) where  import           Control.DeepSeq (NFData(rnf))@@ -18,47 +20,53 @@ -------------------------------------------------------------------------------- -- $defaults ----- You can use 'grnf' as your generic 'rnf' for any 'Representable' type as--- follows:+-- You can use 'grnfDefault' as your generic 'rnf' for any 'Representable' type+-- as follows: -- -- @--- instance 'NFData' MyType where rnf = 'grnf'+-- instance 'NFData' MyType where rnf = 'grnfDefault' -- @ -grnf :: (Representable a, GNFData (Rep a)) => a -> ()-grnf = \a -> grnf' (from a)-{-# INLINABLE grnf #-}+grnfDefault :: (Representable a, GNFData (Rep a)) => a -> ()+grnfDefault = \a -> grnf (from a)+{-# INLINABLE grnfDefault #-} +-- | @'RepGNFData'@ is simply a synonym for+-- @('Representable' a, 'GNFData' ('Rep' a))@ with the convenient+-- kind @(* -> 'GHC.Exts.Constraint')@+class (Representable a, GNFData (Rep a)) => RepGNFData a+instance (Representable a, GNFData (Rep a)) => RepGNFData a+ --------------------------------------------------------------------------------  class GNFData a where-  grnf' :: a -> ()+  grnf :: a -> ()  instance GNFData Z where-  grnf' _ = error-    "Generics.Instant.Functions.DeepSeq.GNFData Z grnf' - impossible"+  grnf _ = error+    "Generics.Instant.Functions.DeepSeq.GNFData Z grnf - impossible"  instance GNFData U where-  grnf' !U = ()-  {-# INLINABLE grnf' #-}+  grnf !U = ()+  {-# INLINABLE grnf #-}  instance GNFData a => GNFData (CEq c p q a) where-  grnf' !(C a) = grnf' a `seq` ()-  {-# INLINABLE grnf' #-}+  grnf !(C a) = grnf a `seq` ()+  {-# INLINABLE grnf #-}  instance (GNFData a, GNFData b) => GNFData (a :*: b) where-  grnf' !(a :*: b) = grnf' a `seq` grnf' b `seq` ()-  {-# INLINABLE grnf' #-}+  grnf !(a :*: b) = grnf a `seq` grnf b `seq` ()+  {-# INLINABLE grnf #-}  instance (GNFData a, GNFData b) => GNFData (a :+: b) where-  grnf' !(L a) = grnf' a `seq` ()-  grnf' !(R b) = grnf' b `seq` ()-  {-# INLINABLE grnf' #-}+  grnf !(L a) = grnf a `seq` ()+  grnf !(R b) = grnf b `seq` ()+  {-# INLINABLE grnf #-}  instance NFData a => GNFData (Var a) where-  grnf' !(Var a) = rnf a `seq` ()-  {-# INLINABLE grnf' #-}+  grnf !(Var a) = rnf a `seq` ()+  {-# INLINABLE grnf #-}  instance NFData a => GNFData (Rec a) where-  grnf' !(Rec a) = rnf a `seq` ()-  {-# INLINABLE grnf' #-}+  grnf !(Rec a) = rnf a `seq` ()+  {-# INLINABLE grnf #-}