Skip to content

Commit aff5ee6

Browse files
committed
deprecate NFData on function types for base-4.20 and up
1 parent 7ce6e2d commit aff5ee6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Control/DeepSeq.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,11 @@ instance NFData1 Fixed where liftRnf _ = rwhnf
531531
-- This assumes that WHNF is equivalent to NF for functions.
532532
--
533533
-- @since 1.3.0.0
534+
#if MIN_VERSION_base(4,20,0)
535+
instance {-# DEPRECATED "NFData is not well-defined on function types." #-} NFData (a -> b) where rnf = rwhnf
536+
#else
534537
instance NFData (a -> b) where rnf = rwhnf
538+
#endif
535539

536540
-- Rational and complex numbers.
537541

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Upcoming
44

5-
5+
* Deprecate function instance starting in GHC 9.10 (`base-4.20`)
6+
([#16](https://github.com/haskell/deepseq/issues/16), [#47](https://github.com/haskell/deepseq/pull/47))
67

78
## 1.5.1.0
89

0 commit comments

Comments
 (0)