From 3cae6cd6abe16b18a1c95598561d5afca1135cec Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sun, 11 Dec 2022 15:05:33 -0800 Subject: [PATCH] Allow building on deepseq < 1.4.2.0 --- src/ShellCheck/CFGAnalysis.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ShellCheck/CFGAnalysis.hs b/src/ShellCheck/CFGAnalysis.hs index cac913e..4e36cf5 100644 --- a/src/ShellCheck/CFGAnalysis.hs +++ b/src/ShellCheck/CFGAnalysis.hs @@ -20,6 +20,7 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DeriveAnyClass, DeriveGeneric #-} +{-# LANGUAGE CPP #-} {- Data Flow Analysis on a Control Flow Graph. @@ -433,6 +434,13 @@ data StackEntry s = StackEntry { } deriving (Eq, Generic, NFData) +#if MIN_VERSION_deepseq(1,4,2) +-- Our deepseq already has a STRef instance +#else +-- Older deepseq (for GHC < 8) lacks this instance +instance NFData (STRef s a) where + rnf = (`seq` ()) +#endif -- Overwrite a base state with the contents of a diff state -- This is unrelated to join/merge.