From fe6994ed37f8e8202292dd7d50bacf790201b71f Mon Sep 17 00:00:00 2001 From: Josef Svenningsson <josef.svenningsson@gmail.com> Date: Mon, 24 Jun 2019 15:37:29 +0100 Subject: [PATCH] Add GNFData instance for unboxed types (#45) --- Control/DeepSeq.hs | 7 +++++++ changelog.md | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/Control/DeepSeq.hs b/Control/DeepSeq.hs index 523fe41..b5b95f2 100644 --- a/Control/DeepSeq.hs +++ b/Control/DeepSeq.hs @@ -179,6 +179,13 @@ instance GNFData arity a => GNFData arity (M1 i c a) where grnf args = grnf args . unM1 {-# INLINEABLE grnf #-} +#if __GLASGOW_HASKELL__ >= 800 + -- @since 1.4.5.0 +instance GNFData arity (URec a) where + grnf _ = rwhnf + {-# INLINEABLE grnf #-} +#endif + instance (GNFData arity a, GNFData arity b) => GNFData arity (a :*: b) where grnf args (x :*: y) = grnf args x `seq` grnf args y {-# INLINEABLE grnf #-} diff --git a/changelog.md b/changelog.md index 789655c..a39a03b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog for [`deepseq` package](http://hackage.haskell.org/package/deepseq) +## 1.4.5.0 + + * Add `GNFData` for URec + This will enable deriving NFData instances for unboxed types + ## 1.4.4.0 *Sep 2018* * Bundled with GHC 8.6.1 -- GitLab