Fix warnings for GHC 9.6 and 9.8
commita11fe009650eaf13f4ba9703273457e1e063fcf6
authorHarendra Kumar <harendra@composewell.com>
dateThu 2 Nov 2023, 17:35 (3 years ago)
parentac1ba5b
benchmark/Streamly/Benchmark/Data/Serialize.hs+1−1
@@ -318,7 +318,7 @@ loop count f val = go count val
318318-- The first arg of "f" is the environment which is not threaded around in the
319319-- loop.
320320{-# INLINE loopWith #-}
321−loopWith :: Int -> (env -> a -> IO b) -> env -> a -> IO ()
321+loopWith :: Int -> (e -> a -> IO b) -> e -> a -> IO ()
322322loopWith count f e val = go count val
323323 where
324324
benchmark/Streamly/Benchmark/Data/Stream/Common.hs+2
@@ -71,7 +71,9 @@ module Stream.Common
7171 )
7272where
7373
74+#if !MIN_VERSION_base(4,18,0)
7475import Control.Applicative (liftA2)
76+#endif
7577import Control.DeepSeq (NFData)
7678import Control.Exception (try)
7779import GHC.Exception (ErrorCall)
benchmark/Streamly/Benchmark/Data/Stream/StreamD.hs+2
@@ -22,7 +22,9 @@
2222
2323module Main (main) where
2424
25+#if !MIN_VERSION_base(4,18,0)
2526import Control.Applicative (liftA2)
27+#endif
2628import Control.Monad (when)
2729import Data.Maybe (isJust)
2830import Gauge (bench, nfIO, bgroup, Benchmark, defaultMain)
benchmark/Streamly/Benchmark/Data/Stream/StreamK.hs+2
@@ -21,7 +21,9 @@
2121
2222module Main (main) where
2323
24+#if !MIN_VERSION_base(4,18,0)
2425import Control.Applicative (liftA2)
26+#endif
2527import Control.Monad (when)
2628import Data.Maybe (isJust)
2729import System.Random (randomRIO)
benchmark/streamly-benchmarks.cabal+4
@@ -145,6 +145,10 @@ common compile-options
145145 -Wno-missing-kind-signatures
146146 -Wno-operator-whitespace
147147
148+ if impl(ghc >= 9.8)
149+ ghc-options:
150+ -Wno-missing-role-annotations
151+
148152 if flag(has-llvm)
149153 ghc-options: -fllvm
150154
core/src/Streamly/Internal/Data/Builder.hs+2
@@ -16,7 +16,9 @@ module Streamly.Internal.Data.Builder
1616 )
1717where
1818
19+#if !MIN_VERSION_base(4,18,0)
1920import Control.Applicative (liftA2)
21+#endif
2022
2123------------------------------------------------------------------------------
2224-- The Builder type
core/src/Streamly/Internal/Data/Fold/Chunked.hs+2
@@ -58,7 +58,9 @@ where
5858
5959#include "ArrayMacros.h"
6060
61+#if !MIN_VERSION_base(4,18,0)
6162import Control.Applicative (liftA2)
63+#endif
6264import Control.Exception (assert)
6365import Control.Monad.IO.Class (MonadIO(..))
6466import Data.Bifunctor (first)
core/src/Streamly/Internal/Data/Fold/Tee.hs+2
@@ -16,7 +16,9 @@ module Streamly.Internal.Data.Fold.Tee
1616 )
1717where
1818
19+#if !MIN_VERSION_base(4,18,0)
1920import Control.Applicative (liftA2)
21+#endif
2022import Streamly.Internal.Data.Fold.Type (Fold)
2123
2224import qualified Streamly.Internal.Data.Fold.Type as Fold
core/src/Streamly/Internal/Data/Fold/Type.hs+2
@@ -442,7 +442,9 @@ where
442442
443443#include "inline.hs"
444444
445+#if !MIN_VERSION_base(4,18,0)
445446import Control.Applicative (liftA2)
447+#endif
446448import Control.Monad ((>=>))
447449import Data.Bifunctor (Bifunctor(..))
448450import Data.Either (fromLeft, fromRight, isLeft, isRight)
core/src/Streamly/Internal/Data/Parser/Type.hs+4−1
@@ -216,7 +216,10 @@ where
216216#include "inline.hs"
217217#include "assert.hs"
218218
219−import Control.Applicative (Alternative(..), liftA2)
219+#if !MIN_VERSION_base(4,18,0)
220+import Control.Applicative (liftA2)
221+#endif
222+import Control.Applicative (Alternative(..))
220223import Control.Exception (Exception(..))
221224-- import Control.Monad (MonadPlus(..), (>=>))
222225import Control.Monad ((>=>))
core/src/Streamly/Internal/Data/ParserK/Type.hs+4−1
@@ -41,7 +41,10 @@ where
4141#include "assert.hs"
4242#include "inline.hs"
4343
44−import Control.Applicative (Alternative(..), liftA2)
44+#if !MIN_VERSION_base(4,18,0)
45+import Control.Applicative (liftA2)
46+#endif
47+import Control.Applicative (Alternative(..))
4548import Control.Monad (MonadPlus(..), ap)
4649import Control.Monad.IO.Class (MonadIO, liftIO)
4750-- import Control.Monad.Trans.Class (MonadTrans(lift))
core/src/Streamly/Internal/Data/Stream/Type.hs+2
@@ -136,7 +136,9 @@ where
136136
137137#include "inline.hs"
138138
139+#if !MIN_VERSION_base(4,18,0)
139140import Control.Applicative (liftA2)
141+#endif
140142import Control.Monad.Catch (MonadThrow, throwM)
141143import Control.Monad.Trans.Class (MonadTrans(lift))
142144import Control.Monad.IO.Class (MonadIO(..))
core/src/Streamly/Internal/Data/StreamK/Type.hs+2
@@ -144,7 +144,9 @@ where
144144import Control.Monad ((>=>))
145145import Control.Monad.Catch (MonadThrow, throwM)
146146import Control.Monad.Trans.Class (MonadTrans(lift))
147+#if !MIN_VERSION_base(4,18,0)
147148import Control.Applicative (liftA2)
149+#endif
148150import Control.Monad.IO.Class (MonadIO(..))
149151import Data.Foldable (Foldable(foldl'), fold, foldr)
150152import Data.Function (fix)
core/src/Streamly/Internal/Data/Time/Units.hs+2−1
@@ -1,4 +1,5 @@
1−{-# LANGUAGE TypeInType #-}
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE PolyKinds #-}
23{-# LANGUAGE UnboxedTuples #-}
34
45-- |
core/streamly-core.cabal+4
@@ -157,6 +157,10 @@ common compile-options
157157 -Wno-redundant-bang-patterns
158158 -Wno-operator-whitespace
159159
160+ if impl(ghc >= 9.8)
161+ ghc-options:
162+ -Wno-missing-role-annotations
163+
160164 if flag(has-llvm)
161165 ghc-options: -fllvm
162166
src/Streamly/Internal/Data/Stream/Zip.hs+2
@@ -27,7 +27,9 @@ module Streamly.Internal.Data.Stream.Zip
2727 )
2828where
2929
30+#if !MIN_VERSION_base(4,18,0)
3031import Control.Applicative (liftA2)
32+#endif
3133import Control.DeepSeq (NFData(..))
3234#if MIN_VERSION_deepseq(1,4,3)
3335import Control.DeepSeq (NFData1(..))
src/Streamly/Internal/Unicode/Char.hs+4
@@ -7,6 +7,10 @@
77-- Stability : experimental
88-- Portability : GHC
99
10+-- XXX We are using head/tail at one place
11+#if __GLASGOW_HASKELL__ >= 908
12+{-# OPTIONS_GHC -Wno-x-partial #-}
13+#endif
1014-- XXX This module should have the reader/writer unfold/refold and read/write
1115-- stream/fold routines to convert a char to/from stream.
1216--
streamly.cabal+4
@@ -266,6 +266,10 @@ common compile-options
266266 -Wno-redundant-bang-patterns
267267 -Wno-operator-whitespace
268268
269+ if impl(ghc >= 9.8)
270+ ghc-options:
271+ -Wno-missing-role-annotations
272+
269273 if flag(has-llvm)
270274 ghc-options: -fllvm
271275
test/Streamly/Test/Data/Parser.hs+4
@@ -1,3 +1,7 @@
1+-- XXX We are using head/tail at one place
2+#if __GLASGOW_HASKELL__ >= 908
3+{-# OPTIONS_GHC -Wno-x-partial #-}
4+#endif
15module Main (main) where
26
37import Control.Applicative ((<|>))
test/Streamly/Test/Data/ParserK.hs+5
@@ -1,3 +1,8 @@
1+-- XXX We are using head/tail at one place
2+#if __GLASGOW_HASKELL__ >= 908
3+{-# OPTIONS_GHC -Wno-x-partial #-}
4+#endif
5+
16module Main (main) where
27
38import Control.Applicative ((<|>))
test/Streamly/Test/Prelude/Serial.hs+4
@@ -1,5 +1,9 @@
11{-# OPTIONS_GHC -Wno-deprecations #-}
22{-# Language TypeApplications #-}
3+-- XXX We are using head/tail at one place
4+#if __GLASGOW_HASKELL__ >= 908
5+{-# OPTIONS_GHC -Wno-x-partial #-}
6+#endif
37
48-- |
59-- Module : Streamly.Test.Prelude.Serial
test/lib/Streamly/Test/Prelude/Common.hs+8−1
@@ -1,4 +1,8 @@
11{-# OPTIONS_GHC -Wno-deprecations #-}
2+-- XXX We are using head/tail at one place
3+#if __GLASGOW_HASKELL__ >= 908
4+{-# OPTIONS_GHC -Wno-x-partial #-}
5+#endif
26
37-- |
48-- Module : Streamly.Test.Prelude.Common
@@ -85,7 +89,10 @@ module Streamly.Test.Prelude.Common
8589 , sortEq
8690 ) where
8791
88−import Control.Applicative (ZipList(..), liftA2)
92+#if !MIN_VERSION_base(4,18,0)
93+import Control.Applicative (liftA2)
94+#endif
95+import Control.Applicative (ZipList(..))
8996import Control.Exception (Exception, try)
9097import Control.Concurrent (threadDelay)
9198import Control.Monad (replicateM)