Skip to content

Commit

Permalink
Add instances for the indexed TypeRep, along with Module #83
Browse files Browse the repository at this point in the history
add CPP to fix CI for 8.0.2

fix cpp for Type.Reflection
  • Loading branch information
Melanie Phoenix committed Aug 26, 2022
1 parent f7904a7 commit 8215dcb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Control/DeepSeq.hs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import Data.Array
import Data.Fixed
import Data.Version
import Data.Monoid as Mon
import Data.Typeable ( TypeRep, TyCon )
import Data.Typeable ( TypeRep, rnfTypeRep, TyCon, rnfTyCon )
import Data.Unique ( Unique )
import Foreign.Ptr
import Foreign.C.Types
Expand All @@ -112,12 +112,12 @@ import Data.Proxy ( Proxy(Proxy) )

#if MIN_VERSION_base(4,10,0)
import Data.Type.Equality ( (:~:), (:~~:) )
import qualified Type.Reflection as Reflection
#else
import Data.Type.Equality ( (:~:) )
#endif

import Data.Functor.Identity ( Identity(..) )
import Data.Typeable ( rnfTypeRep, rnfTyCon )
import Data.Void ( Void, absurd )
import Numeric.Natural ( Natural )

Expand Down Expand Up @@ -644,6 +644,15 @@ instance NFData TypeRep where
instance NFData TyCon where
rnf tycon = rnfTyCon tycon

#if MIN_VERSION_base(4,10,0)
-- |@since 1.4.8.0
instance NFData (Reflection.TypeRep a) where
rnf tr = Reflection.rnfTypeRep tr

-- |@since 1.4.8.0
instance NFData Reflection.Module where
rnf modul = Reflection.rnfModule modul
#endif

-- | __NOTE__: Only strict in the reference and not the referenced value.
--
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Adapt the rename of the Solo constructor to MkSolo
([#87](https://github.com/haskell/deepseq/pull/87))
* Add instances for the indexed `TypeRep`, along with `Module`.
([#83](https://github.com/haskell/deepseq/pull/83))

## 1.4.8.0

Expand Down

0 comments on commit 8215dcb

Please sign in to comment.