From 62b9a7b23b20f5cf0a2de14251c2096098009f10 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Wed, 7 Dec 2022 19:24:59 +0530 Subject: Force the Docs structure to prevent leaks in GHCi with -haddock without -fwrite-interface Involves adding many new NFData instances. Without forcing Docs, references to the TcGblEnv for each module are retained by the Docs structure. Usually these are forced when the ModIface is serialised but not when we aren't writing the interface. --- compiler/Language/Haskell/Syntax/Basic.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/Language') diff --git a/compiler/Language/Haskell/Syntax/Basic.hs b/compiler/Language/Haskell/Syntax/Basic.hs index 77ad3fe0e0..687349d021 100644 --- a/compiler/Language/Haskell/Syntax/Basic.hs +++ b/compiler/Language/Haskell/Syntax/Basic.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE GeneralisedNewtypeDeriving #-} module Language.Haskell.Syntax.Basic where import Data.Data @@ -8,6 +9,7 @@ import Data.Bool import Data.Int (Int) import GHC.Data.FastString (FastString) +import Control.DeepSeq {- ************************************************************************ @@ -54,7 +56,7 @@ Field Labels -- | Field labels are just represented as strings; -- they are not necessarily unique (even within a module) newtype FieldLabelString = FieldLabelString { field_label:: FastString } - deriving (Data, Eq) + deriving (Data, Eq, NFData) {- ************************************************************************ -- cgit v1.2.1