Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose NFData instance for Down on earlier versions of base #28

Merged
merged 1 commit into from
Apr 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Control/DeepSeq.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ import System.Mem.StableName ( StableName )

#if MIN_VERSION_base(4,6,0)
import Data.Ord ( Down(Down) )
#else
import GHC.Exts ( Down(Down) )
#endif

#if MIN_VERSION_base(4,7,0)
Expand Down Expand Up @@ -507,13 +509,11 @@ instance NFData2 Array where
liftRnf2 r r' x = liftRnf2 r r (bounds x) `seq` liftRnf r' (Data.Array.elems x)
#endif

#if MIN_VERSION_base(4,6,0)
-- |@since 1.4.0.0
instance NFData a => NFData (Down a) where rnf = rnf1
-- |@since 1.4.3.0
instance NFData1 Down where
liftRnf r (Down x) = r x
#endif

-- |@since 1.4.0.0
instance NFData a => NFData (Dual a) where rnf = rnf1
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
([#13](https://github.com/haskell/deepseq/issues/13))
* Add `NFData Ordering` ([#25](https://github.com/haskell/deepseq/pull/25))
* Add `NFData1` and `NFData2` type classes ([#8](https://github.com/haskell/deepseq/issues/8))
* Expose `NFData` instance for `Down` on earlier versions of `base`

## 1.4.2.0 *Apr 2016*

Expand Down