Fix warnings for GHC 9.6 and 9.8

This commit is contained in:
Harendra Kumar 2023-11-02 17:35:17 +05:30
parent ac1ba5b280
commit a11fe00965
22 changed files with 68 additions and 5 deletions

View File

@ -318,7 +318,7 @@ loop count f val = go count val
-- The first arg of "f" is the environment which is not threaded around in the
-- loop.
{-# INLINE loopWith #-}
loopWith :: Int -> (env -> a -> IO b) -> env -> a -> IO ()
loopWith :: Int -> (e -> a -> IO b) -> e -> a -> IO ()
loopWith count f e val = go count val
where

View File

@ -71,7 +71,9 @@ module Stream.Common
)
where
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.DeepSeq (NFData)
import Control.Exception (try)
import GHC.Exception (ErrorCall)

View File

@ -22,7 +22,9 @@
module Main (main) where
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Monad (when)
import Data.Maybe (isJust)
import Gauge (bench, nfIO, bgroup, Benchmark, defaultMain)

View File

@ -21,7 +21,9 @@
module Main (main) where
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Monad (when)
import Data.Maybe (isJust)
import System.Random (randomRIO)

View File

@ -145,6 +145,10 @@ common compile-options
-Wno-missing-kind-signatures
-Wno-operator-whitespace
if impl(ghc >= 9.8)
ghc-options:
-Wno-missing-role-annotations
if flag(has-llvm)
ghc-options: -fllvm

View File

@ -16,7 +16,9 @@ module Streamly.Internal.Data.Builder
)
where
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
------------------------------------------------------------------------------
-- The Builder type

View File

@ -58,7 +58,9 @@ where
#include "ArrayMacros.h"
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Exception (assert)
import Control.Monad.IO.Class (MonadIO(..))
import Data.Bifunctor (first)

View File

@ -16,7 +16,9 @@ module Streamly.Internal.Data.Fold.Tee
)
where
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Streamly.Internal.Data.Fold.Type (Fold)
import qualified Streamly.Internal.Data.Fold.Type as Fold

View File

@ -442,7 +442,9 @@ where
#include "inline.hs"
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Monad ((>=>))
import Data.Bifunctor (Bifunctor(..))
import Data.Either (fromLeft, fromRight, isLeft, isRight)

View File

@ -216,7 +216,10 @@ where
#include "inline.hs"
#include "assert.hs"
import Control.Applicative (Alternative(..), liftA2)
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Applicative (Alternative(..))
import Control.Exception (Exception(..))
-- import Control.Monad (MonadPlus(..), (>=>))
import Control.Monad ((>=>))

View File

@ -41,7 +41,10 @@ where
#include "assert.hs"
#include "inline.hs"
import Control.Applicative (Alternative(..), liftA2)
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Applicative (Alternative(..))
import Control.Monad (MonadPlus(..), ap)
import Control.Monad.IO.Class (MonadIO, liftIO)
-- import Control.Monad.Trans.Class (MonadTrans(lift))

View File

@ -136,7 +136,9 @@ where
#include "inline.hs"
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Monad.Catch (MonadThrow, throwM)
import Control.Monad.Trans.Class (MonadTrans(lift))
import Control.Monad.IO.Class (MonadIO(..))

View File

@ -144,7 +144,9 @@ where
import Control.Monad ((>=>))
import Control.Monad.Catch (MonadThrow, throwM)
import Control.Monad.Trans.Class (MonadTrans(lift))
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Monad.IO.Class (MonadIO(..))
import Data.Foldable (Foldable(foldl'), fold, foldr)
import Data.Function (fix)

View File

@ -1,4 +1,5 @@
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UnboxedTuples #-}
-- |

View File

@ -157,6 +157,10 @@ common compile-options
-Wno-redundant-bang-patterns
-Wno-operator-whitespace
if impl(ghc >= 9.8)
ghc-options:
-Wno-missing-role-annotations
if flag(has-llvm)
ghc-options: -fllvm

View File

@ -27,7 +27,9 @@ module Streamly.Internal.Data.Stream.Zip
)
where
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.DeepSeq (NFData(..))
#if MIN_VERSION_deepseq(1,4,3)
import Control.DeepSeq (NFData1(..))

View File

@ -7,6 +7,10 @@
-- Stability : experimental
-- Portability : GHC
-- XXX We are using head/tail at one place
#if __GLASGOW_HASKELL__ >= 908
{-# OPTIONS_GHC -Wno-x-partial #-}
#endif
-- XXX This module should have the reader/writer unfold/refold and read/write
-- stream/fold routines to convert a char to/from stream.
--

View File

@ -266,6 +266,10 @@ common compile-options
-Wno-redundant-bang-patterns
-Wno-operator-whitespace
if impl(ghc >= 9.8)
ghc-options:
-Wno-missing-role-annotations
if flag(has-llvm)
ghc-options: -fllvm

View File

@ -1,3 +1,7 @@
-- XXX We are using head/tail at one place
#if __GLASGOW_HASKELL__ >= 908
{-# OPTIONS_GHC -Wno-x-partial #-}
#endif
module Main (main) where
import Control.Applicative ((<|>))

View File

@ -1,3 +1,8 @@
-- XXX We are using head/tail at one place
#if __GLASGOW_HASKELL__ >= 908
{-# OPTIONS_GHC -Wno-x-partial #-}
#endif
module Main (main) where
import Control.Applicative ((<|>))

View File

@ -1,5 +1,9 @@
{-# OPTIONS_GHC -Wno-deprecations #-}
{-# Language TypeApplications #-}
-- XXX We are using head/tail at one place
#if __GLASGOW_HASKELL__ >= 908
{-# OPTIONS_GHC -Wno-x-partial #-}
#endif
-- |
-- Module : Streamly.Test.Prelude.Serial

View File

@ -1,4 +1,8 @@
{-# OPTIONS_GHC -Wno-deprecations #-}
-- XXX We are using head/tail at one place
#if __GLASGOW_HASKELL__ >= 908
{-# OPTIONS_GHC -Wno-x-partial #-}
#endif
-- |
-- Module : Streamly.Test.Prelude.Common
@ -85,7 +89,10 @@ module Streamly.Test.Prelude.Common
, sortEq
) where
import Control.Applicative (ZipList(..), liftA2)
#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Control.Applicative (ZipList(..))
import Control.Exception (Exception, try)
import Control.Concurrent (threadDelay)
import Control.Monad (replicateM)