@@ -42,6 +42,7 @@ import System.Mem (performMajorGC)
42import Streamly.Internal.Data.SVar
42import Streamly.Internal.Data.SVar
43import Streamly.Internal.Data.Stream.StreamK hiding (reverse)
43import Streamly.Internal.Data.Stream.StreamK hiding (reverse)
45+#if __GLASGOW_HASKELL__ < 810
45#ifdef INSPECTION
46#ifdef INSPECTION
46import Control.Exception (Exception)
47import Control.Exception (Exception)
47import Control.Monad.Catch (MonadThrow)
48import Control.Monad.Catch (MonadThrow)
@@ -49,6 +50,7 @@ import Control.Monad.Trans.Control (MonadBaseControl)
49import Data.Typeable (Typeable)
50import Data.Typeable (Typeable)
50import Test.Inspection (inspect, hasNoTypeClassesExcept)
51import Test.Inspection (inspect, hasNoTypeClassesExcept)
53-- | Pull a stream from an SVar.
55-- | Pull a stream from an SVar.
54{-# NOINLINE fromStreamVar #-}
56{-# NOINLINE fromStreamVar #-}
@@ -101,6 +103,7 @@ fromStreamVar sv = MkStream $ \st yld sng stp -> do
101 sid <- liftIO $ readIORef (svarStopBy sv)
103 sid <- liftIO $ readIORef (svarStopBy sv)
102 return $ if tid == sid then True else False
104 return $ if tid == sid then True else False
106+#if __GLASGOW_HASKELL__ < 810
104#ifdef INSPECTION
107#ifdef INSPECTION
105-- Use of GHC constraint tuple (GHC.Classes.(%,,%)) in fromStreamVar leads to
108-- Use of GHC constraint tuple (GHC.Classes.(%,,%)) in fromStreamVar leads to
106-- space leak because the tuple gets allocated in every recursive call and each
109-- space leak because the tuple gets allocated in every recursive call and each
@@ -118,6 +121,7 @@ inspect $ hasNoTypeClassesExcept 'fromStreamVar
118 , ''Functor
121 , ''Functor
122{-# INLINE fromSVar #-}
126{-# INLINE fromSVar #-}
123fromSVar :: (MonadAsync m, IsStream t) => SVar Stream m a -> t m a
127fromSVar :: (MonadAsync m, IsStream t) => SVar Stream m a -> t m a