From 4ff819906d65bbde215f950b906be9c49eccec23 Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Sat, 9 Jan 2016 18:51:18 +0300 Subject: [PATCH] NFData ByteString instance for GHC-7.4 --- Language/Haskell/GhcMod/Gap.hs | 11 +++++++++++ Language/Haskell/GhcMod/Output.hs | 1 + 2 files changed, 12 insertions(+) diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs index 79c63de..48337e0 100644 --- a/Language/Haskell/GhcMod/Gap.hs +++ b/Language/Haskell/GhcMod/Gap.hs @@ -101,6 +101,11 @@ import Module import qualified Data.IntSet as I (IntSet, empty) #endif +#if __GLASGOW_HASKELL__ < 706 +import Control.DeepSeq (NFData(rnf)) +import Data.ByteString.Lazy.Internal (ByteString(..)) +#endif + import Bag import Lexer as L import Parser @@ -564,3 +569,9 @@ mkErrStyle' = Outputable.mkErrStyle #else mkErrStyle' _ = Outputable.mkErrStyle #endif + +#if __GLASGOW_HASKELL__ < 706 +instance NFData ByteString where + rnf Empty = () + rnf (Chunk _ b) = rnf b +#endif diff --git a/Language/Haskell/GhcMod/Output.hs b/Language/Haskell/GhcMod/Output.hs index ae6b832..f8dfa4b 100644 --- a/Language/Haskell/GhcMod/Output.hs +++ b/Language/Haskell/GhcMod/Output.hs @@ -55,6 +55,7 @@ import Prelude import Language.Haskell.GhcMod.Types hiding (LineSeparator, MonadIO(..)) import Language.Haskell.GhcMod.Monad.Types hiding (MonadIO(..)) +import Language.Haskell.GhcMod.Gap () class ProcessOutput a where hGetContents' :: Handle -> IO a