on master help sign in
Add GHC 8.10.1 build to CI.

- Disable inspection testing for `fromStreamVar`. - Fix overlapping pattern matches warning in test/Main.hs.

commit828a564781b2c9da5608950651938c79a4e45226 authorPranay Sashank <pranaysashank@composewell.com> dateMon 20 Apr 2020, 16:23 (6 years ago) parent451239b
4 files changed+14−9
.github/workflows/haskell.yml+6−2 src/Streamly/Internal/Data/Stream/SVar.hs+4 streamly.cabal+1 test/Main.hs+3−7
.github/workflows/haskell.yml+6−2
@@ -34,9 +34,13 @@ jobs:
3434 strategy:
3535 fail-fast: false
3636 matrix:
37− name: [8.8.3+inspection+Werror, 8.6.5+streamk, 8.6.5+fusion-plugin]
38− cabal_version: ["3.0"]
37+ name: [8.10.1+inspection+Werror, 8.8.3+inspection+Werror, 8.6.5+streamk, 8.6.5+fusion-plugin]
38+ cabal_version: ["3.2"]
3939 include:
40+ - name: 8.10.1+inspection+Werror
41+ ghc_version: 8.10.1
42+ build: cabal-v2
43+ cabal_build_options: "--project-file=cabal.project.ci"
4044 - name: 8.8.3+inspection+Werror
4145 ghc_version: 8.8.3
4246 build: cabal-v2
src/Streamly/Internal/Data/Stream/SVar.hs+4
@@ -42,6 +42,7 @@ import System.Mem (performMajorGC)
4242import Streamly.Internal.Data.SVar
4343import Streamly.Internal.Data.Stream.StreamK hiding (reverse)
4444
45+#if __GLASGOW_HASKELL__ < 810
4546#ifdef INSPECTION
4647import Control.Exception (Exception)
4748import Control.Monad.Catch (MonadThrow)
@@ -49,6 +50,7 @@ import Control.Monad.Trans.Control (MonadBaseControl)
4950import Data.Typeable (Typeable)
5051import Test.Inspection (inspect, hasNoTypeClassesExcept)
5152#endif
53+#endif
5254
5355-- | Pull a stream from an SVar.
5456{-# NOINLINE fromStreamVar #-}
@@ -101,6 +103,7 @@ fromStreamVar sv = MkStream $ \st yld sng stp -> do
101103 sid <- liftIO $ readIORef (svarStopBy sv)
102104 return $ if tid == sid then True else False
103105
106+#if __GLASGOW_HASKELL__ < 810
104107#ifdef INSPECTION
105108-- Use of GHC constraint tuple (GHC.Classes.(%,,%)) in fromStreamVar leads to
106109-- space leak because the tuple gets allocated in every recursive call and each
@@ -118,6 +121,7 @@ inspect $ hasNoTypeClassesExcept 'fromStreamVar
118121 , ''Functor
119122 ]
120123#endif
124+#endif
121125
122126{-# INLINE fromSVar #-}
123127fromSVar :: (MonadAsync m, IsStream t) => SVar Stream m a -> t m a
streamly.cabal+1
@@ -86,6 +86,7 @@ tested-with: GHC==7.10.3
8686 , GHC==8.4.4
8787 , GHC==8.6.5
8888 , GHC==8.8.1
89+ , GHC==8.10.1
8990author: Harendra Kumar
9091maintainer: streamly@composewell.com
9192copyright: 2017 Harendra Kumar
test/Main.hs+3−7
@@ -6,7 +6,7 @@
66module Main (main) where
77
88import Control.Concurrent (threadDelay)
9−import Control.Exception (Exception, try, ErrorCall(..), catch, throw)
9+import Control.Exception (Exception, try, ErrorCall(..), catch)
1010import Control.Monad (void)
1111import Control.Monad.Catch (throwM, MonadThrow)
1212import Control.Monad.Error.Class (throwError, MonadError)
@@ -669,9 +669,7 @@ checkFoldl'Strictness = do
669669 let s = return (1 :: Int) `S.consM` error "failure"
670670 catch (S.foldl' (\_ a -> if a == 1 then error "success" else "done")
671671 "begin" s)
672− (\e -> case e of
673− ErrorCall err -> return err
674− _ -> throw e)
672+ (\(ErrorCall err) -> return err)
675673 `shouldReturn` "success"
676674
677675#ifdef DEVBUILD
@@ -708,9 +706,7 @@ checkScanl'Strictness = do
708706 s)
709707 >> return "finished"
710708 )
711− (\e -> case e of
712− ErrorCall err -> return err
713− _ -> throw e)
709+ (\(ErrorCall err) -> return err)
714710 `shouldReturn` "success"
715711
716712foldlM'StrictCheck :: IORef Int -> SerialT IO Int -> IO ()