diff options
author | Simon Marlow <smarlow@fb.com> | 2016-07-21 04:32:55 -0700 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2016-07-22 13:56:41 +0100 |
commit | c4f3d91b6b32a27c2e00506de532e90c595de2d1 (patch) | |
tree | 75e294b134c3cc6e83c69a0171925718dfbd3270 /libraries/ghci/SizedSeq.hs | |
parent | bfef2eb1898641f250a1b39fe67c18963a709534 (diff) | |
download | haskell-c4f3d91b6b32a27c2e00506de532e90c595de2d1.tar.gz |
Add deepseq dependency and a few NFData instances
I needed to rnf a data structure (CompiledByteCode) but we don't have
any good deepseq infrastructure in the compiler yet. There are bits and
pieces, but nothing consistent, so this is a start.
We already had a dependency on deepseq indirectly via other packages
(e.g. containers).
Includes an update to the haddock submodule, to remove orphan NFData
instances in there.
Test Plan: validate
Reviewers: austin, bgamari, erikd, hvr
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2418
Diffstat (limited to 'libraries/ghci/SizedSeq.hs')
-rw-r--r-- | libraries/ghci/SizedSeq.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libraries/ghci/SizedSeq.hs b/libraries/ghci/SizedSeq.hs index e5bb37c2f1..503544a9ed 100644 --- a/libraries/ghci/SizedSeq.hs +++ b/libraries/ghci/SizedSeq.hs @@ -8,6 +8,7 @@ module SizedSeq , sizeSS ) where +import Control.DeepSeq import Data.Binary import Data.List import GHC.Generics @@ -26,6 +27,9 @@ instance Traversable SizedSeq where instance Binary a => Binary (SizedSeq a) +instance NFData a => NFData (SizedSeq a) where + rnf (SizedSeq _ xs) = rnf xs + emptySS :: SizedSeq a emptySS = SizedSeq 0 [] |