Skip to content

Commit 1b18102

Browse files
committedMay 20, 2023
Future-proof against potential Prelude.foldl'
1 parent f70b360 commit 1b18102

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
 

‎src/Common.hs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{-# LANGUAGE CPP #-}
22
module Common where
33

4+
#if MIN_VERSION_base(4,6,0)
5+
import Prelude hiding ( Foldable(..) )
6+
#else
7+
import Data.List ( foldl' )
8+
#endif
49
import qualified Control.Exception as Exception
510
import qualified Compat.TempFile as Compat
611
import Control.Monad ( when )
712
import Data.Char ( isSpace )
8-
import Data.List ( foldl' )
13+
import Data.Foldable ( Foldable(..) )
914
import System.IO
1015
#if defined(mingw32_HOST_OS)
1116
import Control.Concurrent ( threadDelay )

‎src/DirectCodegen.hs

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ The standard mode for hsc2hs: generates a C file which is
66
compiled and run; the output of that program is the .hs file.
77
-}
88

9+
#if MIN_VERSION_base(4,6,0)
10+
import Prelude hiding ( Foldable(..) )
11+
#else
12+
import Data.List ( foldl' )
13+
#endif
914
import Data.Char ( isAlphaNum, toUpper )
10-
import Data.Foldable ( foldl' )
15+
import Data.Foldable ( Foldable(..) )
1116
import Control.Monad ( when, forM_ )
1217

1318
import System.Exit ( ExitCode(..), exitWith )

0 commit comments

Comments
 (0)
Please sign in to comment.