summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorSimon Marlow <smarlow@fb.com>2016-07-21 04:32:55 -0700
committerSimon Marlow <marlowsd@gmail.com>2016-07-22 13:56:41 +0100
commitc4f3d91b6b32a27c2e00506de532e90c595de2d1 (patch)
tree75e294b134c3cc6e83c69a0171925718dfbd3270 /compiler/utils
parentbfef2eb1898641f250a1b39fe67c18963a709534 (diff)
downloadhaskell-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 'compiler/utils')
-rw-r--r--compiler/utils/FastString.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs
index 651719a65a..1496a8686e 100644
--- a/compiler/utils/FastString.hs
+++ b/compiler/utils/FastString.hs
@@ -1,6 +1,7 @@
-- (c) The University of Glasgow, 1997-2006
-{-# LANGUAGE BangPatterns, CPP, MagicHash, UnboxedTuples #-}
+{-# LANGUAGE BangPatterns, CPP, MagicHash, UnboxedTuples,
+ GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -O -funbox-strict-fields #-}
-- We always optimise this, otherwise performance of a non-optimised
-- compiler is severely affected
@@ -97,6 +98,7 @@ import FastFunctions
import Panic
import Util
+import Control.DeepSeq
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
@@ -145,6 +147,7 @@ hashByteString bs
-- -----------------------------------------------------------------------------
newtype FastZString = FastZString ByteString
+ deriving NFData
hPutFZS :: Handle -> FastZString -> IO ()
hPutFZS handle (FastZString bs) = BS.hPut handle bs