@@ -548,28 +548,19 @@ instance (NoThunks a, Typeable s, Typeable a) => NoThunks (MutableHeap s a) wher
548548-- Some constraints, like @NoThunks (MutVar s a)@ and @NoThunks (StrictTVar m
549549-- a)@, can not be satisfied for arbitrary @m@\/@s@, and must be instantiated
550550-- for a concrete @m@\/@s@, like @IO@\/@RealWorld@.
551- class ( forall a . NoThunks a => NoThunks (StrictTVar m a )
551+ class ( forall a . ( NoThunks a , Typeable a ) => NoThunks (StrictTVar m a )
552552 , forall a . (NoThunks a , Typeable a ) => NoThunks (StrictMVar m a )
553553 ) => NoThunksIOLike' m s
554554
555555instance NoThunksIOLike' IO RealWorld
556556
557557type NoThunksIOLike m = NoThunksIOLike' m (PrimState m )
558558
559- -- TODO: on ghc-9.4, a check on StrictTVar IO (RWState (TableContent IO h))
560- -- fails, but we have not yet found out why so we simply disable NoThunks checks
561- -- for StrictTVars on ghc-9.4
562- instance NoThunks a => NoThunks (StrictTVar IO a ) where
563- showTypeOf (_ :: Proxy (StrictTVar IO a )) = " StrictTVar IO"
559+ instance (NoThunks a , Typeable a ) => NoThunks (StrictTVar IO a ) where
560+ showTypeOf (p :: Proxy (StrictTVar IO a )) = show $ typeRep p
564561 wNoThunks _ctx _var = do
565- #if defined(MIN_VERSION_GLASGOW_HASKELL)
566- #if MIN_VERSION_GLASGOW_HASKELL(9,4,0,0) && !MIN_VERSION_GLASGOW_HASKELL(9,6,0,0)
567- pure Nothing
568- #else
569562 x <- readTVarIO _var
570563 noThunks _ctx x
571- #endif
572- #endif
573564
574565-- TODO: in some cases, strict-mvar functions leave thunks behind, in particular
575566-- modifyMVarMasked and modifyMVarMasked_. So in some specific cases we evaluate
0 commit comments