@@ -9,6 +9,7 @@
99{-# LANGUAGE GADTs #-}
1010{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1111{-# LANGUAGE LambdaCase #-}
12+{-# LANGUAGE MultiWayIf #-}
1213{-# LANGUAGE RankNTypes #-}
1314{-# LANGUAGE RoleAnnotations #-}
1415{-# LANGUAGE ScopedTypeVariables #-}
@@ -19,7 +20,7 @@
1920{-# LANGUAGE DeriveFunctor #-}
2021{-# LANGUAGE StandaloneDeriving #-}
2122{-# LANGUAGE InstanceSigs #-}
22−{-# LANGUAGE MultiWayIf #-}
23+{-# LANGUAGE RecursiveDo #-}
2324
2425#ifdef USE_REFLEX_OPTIMIZER
2526{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
@@ -38,17 +39,15 @@ import Control.Monad hiding (forM, forM_, mapM, mapM_)
3839import Control.Monad.Exception
3940import Control.Monad.Identity hiding (forM, forM_, mapM, mapM_)
4041import Control.Monad.Primitive
42+--import Control.Monad.Reader hiding (forM, forM_, mapM, mapM_)
4143import Control.Monad.Reader.Class
4244import Control.Monad.IO.Class
4345import Control.Monad.ReaderIO
4446import Control.Monad.Ref
45−import Control.Monad.Fail (MonadFail)
46−import qualified Control.Monad.Fail as MonadFail
4747import Data.Align
4848import Data.Coerce
49−import Data.Dependent.Map (DMap)
49+import Data.Dependent.Map (DMap, DSum (..))
5050import qualified Data.Dependent.Map as DMap
51−import Data.Dependent.Sum (DSum (..))
5251import Data.FastMutableIntMap (FastMutableIntMap, PatchIntMap (..))
5352import qualified Data.FastMutableIntMap as FastMutableIntMap
5453import Data.Foldable hiding (concat, elem, sequence_)
@@ -65,7 +64,6 @@ import Data.Monoid (mempty, (<>))
6564import Data.Proxy
6665import Data.These
6766import Data.Traversable
68−import Data.Type.Equality ((:~:)(Refl))
6967import Data.Witherable (Filterable, mapMaybe)
7068import GHC.Exts hiding (toList)
7169import GHC.IORef (IORef (..))
@@ -86,9 +84,9 @@ import Data.Zip (Zip (..))
8684
8785#ifdef DEBUG_CYCLES
8886import Control.Monad.State hiding (forM, forM_, mapM, mapM_, sequence)
87+import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
8988#endif
9089
91−import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
9290import qualified Data.List.NonEmpty as NonEmpty
9391import Data.Tree (Forest, Tree (..), drawForest)
9492import Data.List (isPrefixOf)
@@ -106,21 +104,15 @@ import qualified Reflex.Class
106104import qualified Reflex.Class as R
107105import qualified Reflex.Host.Class
108106import Reflex.NotReady.Class
109−import Data.Patch
110−import qualified Data.Patch.DMapWithMove as PatchDMapWithMove
107+import Reflex.Patch
108+import qualified Reflex.Patch.DMapWithMove as PatchDMapWithMove
111109import Reflex.PerformEvent.Base (PerformEventT)
112110
113111#ifdef DEBUG_TRACE_EVENTS
114112import qualified Data.ByteString.Char8 as BS8
115113import System.IO (stderr)
116114import Data.List (isPrefixOf)
117−#endif
118−
119−-- TODO stdout might not be the best channel for debug output
120−debugStrLn :: String -> IO ()
121−debugStrLn = putStrLn
122115
123−#ifdef DEBUG_TRACE_EVENTS
124116withStackOneLine :: (BS8.ByteString -> a) -> a
125117withStackOneLine expr = unsafePerformIO $ do
126118 stack <- currentCallStack
@@ -129,33 +121,9 @@ withStackOneLine expr = unsafePerformIO $ do
129121
130122#endif
131123
132−debugPropagate :: Bool
133−
134−debugInvalidateHeight :: Bool
135−
136−debugInvalidate :: Bool
137−
138124#ifdef DEBUG
139125#define DEBUG_NODEIDS
140126
141−#ifdef DEBUG_TRACE_PROPAGATION
142−debugPropagate = True
143−#else
144−debugPropagate = False
145−#endif
146−
147−#ifdef DEBUG_TRACE_HEIGHT
148−debugInvalidateHeight = True
149−#else
150−debugInvalidateHeight = False
151−#endif
152−
153−#ifdef DEBUG_TRACE_INVALIDATION
154−debugInvalidate = True
155−#else
156−debugInvalidate = False
157−#endif
158−
159127class HasNodeId a where
160128 getNodeId :: a -> Int
161129
@@ -193,19 +161,11 @@ showNodeId' = ("#"<>) . show
193161
194162#else
195163
196−debugPropagate = False
197−debugInvalidateHeight = False
198−debugInvalidate = False
199−
200164-- This must be inline, or error messages will cause memory leaks due to retaining the node in question
201165{-# INLINE showNodeId #-}
202166showNodeId :: a -> String
203167showNodeId _ = ""
204168
205−{-# INLINE showNodeId' #-}
206−showNodeId' :: Int -> String
207−showNodeId' _ = ""
208−
209169#endif
210170
211171#ifdef DEBUG_NODEIDS
@@ -253,11 +213,11 @@ subscribeAndRead = unEvent
253213{-# INLINE [1] pushCheap #-}
254214pushCheap :: HasSpiderTimeline x => (a -> ComputeM x (Maybe b)) -> Event x a -> Event x b
255215pushCheap !f e = Event $ \sub -> do
256− (subscription, occ) <- subscribeAndRead e $ debugSubscriber' "push" $ sub
216+ (subscription, occ) <- subscribeAndRead e $ debugSubscriber' "push" (sub
257217 { subscriberPropagate = \a -> do
258218 mb <- f a
259219 mapM_ (subscriberPropagate sub) mb
260− }
220+ })
261221 occ' <- join <$> mapM f occ
262222 return (subscription, occ')
263223
@@ -307,20 +267,7 @@ data CacheSubscribed x a
307267#endif
308268 }
309269
310−nowSpiderEventM :: (HasSpiderTimeline x) => EventM x (R.Event (SpiderTimeline x) ())
311−nowSpiderEventM =
312− SpiderEvent <$> now
313−
314−now :: (MonadIO m, Defer (Some Clear) m, HasSpiderTimeline x
315− ) => m (Event x ())
316−now = do
317− nowOrNot <- liftIO $ newIORef $ Just ()
318− scheduleClear nowOrNot
319− return . Event $ \_ -> do
320− occ <- liftIO . readIORef $ nowOrNot
321− return ( EventSubscription (return ()) eventSubscribedNow
322− , occ
323− )
270+
324271
325272-- | Construct an 'Event' whose value is guaranteed not to be recomputed
326273-- repeatedly
@@ -351,18 +298,39 @@ cacheEvent e =
351298#endif
352299 subscribers <- liftIO FastWeakBag.empty
353300 occRef <- liftIO $ newIORef Nothing -- This should never be read prior to being set below
354−#ifdef DEBUG_NODEIDS
301+<<<<<<< HEAD
355302 (parentSub, occ) <- subscribeAndRead e $ debugSubscriber' ("cacheEvent" <> showNodeId' nodeId) $ Subscriber
356−#else
357− (parentSub, occ) <- subscribeAndRead e $ Subscriber
358−#endif
359303 { subscriberPropagate = \a -> do
304+ -- checkCycle (_eventSubscription_subscribed parentSub)
360305 liftIO $ writeIORef occRef (Just a)
361306 scheduleClear occRef
362307 propagateFast a subscribers
363− , subscriberInvalidateHeight = FastWeakBag.traverse_ subscribers . invalidateSubscriberHeight
364− , subscriberRecalculateHeight = FastWeakBag.traverse_ subscribers . recalculateSubscriberHeight
308+ , subscriberInvalidateHeight = FastWeakBag.traverse subscribers . invalidateSubscriberHeight
309+ , subscriberRecalculateHeight = FastWeakBag.traverse subscribers . recalculateSubscriberHeight
365310 }
311+||||||| merged common ancestors
312+ (parentSub, occ) <- subscribeAndRead e $ Subscriber
313+ { subscriberPropagate = \a -> do
314+ liftIO $ writeIORef occRef $ Just a
315+ scheduleClear occRef
316+ propagateFast a subscribers
317+ , subscriberInvalidateHeight = \old -> do
318+ FastWeakBag.traverse subscribers $ invalidateSubscriberHeight old
319+ , subscriberRecalculateHeight = \new -> do
320+ FastWeakBag.traverse subscribers $ recalculateSubscriberHeight new
321+ }
322+=======
323+ (parentSub, occ) <- subscribeAndRead e $ Subscriber
324+ { subscriberPropagate = \a -> do
325+ liftIO $ writeIORef occRef $ Just a
326+ scheduleClear occRef
327+ propagateFast a subscribers
328+ , subscriberInvalidateHeight = \old -> do
329+ FastWeakBag.traverse_ subscribers $ invalidateSubscriberHeight old
330+ , subscriberRecalculateHeight = \new -> do
331+ FastWeakBag.traverse_ subscribers $ recalculateSubscriberHeight new
332+ }
333+>>>>>>> develop
366334 when (isJust occ) $ do
367335 liftIO $ writeIORef occRef occ -- Set the initial value of occRef; we don't need to do this if occ is Nothing
368336 scheduleClear occRef
@@ -464,6 +432,16 @@ data Subscriber x a = Subscriber
464432 , subscriberRecalculateHeight :: !(Height -> IO ())
465433 }
466434
435+--TODO: Move this comment to WeakBag
436+-- These function are constructor functions that are marked NOINLINE so they are
437+-- opaque to GHC. If we do not do this, then GHC will sometimes fuse the constructor away
438+-- so any weak references that are attached to the constructors will have their
439+-- finalizer run. Using the opaque constructor, does not see the
440+-- constructor application, so it behaves like an IORef and cannot be fused away.
441+--
442+-- The result is also evaluated to WHNF, since forcing a thunk invalidates
443+-- the weak pointer to it in some cases.
444+
467445newSubscriberHold :: (HasSpiderTimeline x, Patch p) => Hold x p -> IO (Subscriber x p)
468446newSubscriberHold h = return $ Subscriber
469447 { subscriberPropagate = {-# SCC "traverseHold" #-} propagateSubscriberHold h
@@ -607,16 +585,6 @@ eventSubscribedNever = EventSubscribed
607585 , eventSubscribedWhoCreated = return ["never"]
608586#endif
609587 }
610−eventSubscribedNow :: EventSubscribed x
611−eventSubscribedNow = EventSubscribed
612− { eventSubscribedHeightRef = zeroRef
613− , eventSubscribedRetained = toAny ()
614−#ifdef DEBUG_CYCLES
615− , eventSubscribedGetParents = return []
616− , eventSubscribedHasOwnHeightRef = False
617− , eventSubscribedWhoCreated = return ["now"]
618−#endif
619− }
620588
621589eventSubscribedFan :: FanSubscribed x k v -> EventSubscribed x
622590eventSubscribedFan !subscribed = EventSubscribed
@@ -994,10 +962,8 @@ instance Monad (BehaviorM x) where
994962 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
995963 {-# INLINE return #-}
996964 return x = BehaviorM $ return x
997−#if !MIN_VERSION_base(4,13,0)
998965 {-# INLINE fail #-}
999966 fail s = BehaviorM $ fail s
1000−#endif
1001967
1002968data BehaviorSubscribed x a
1003969 = forall p. BehaviorSubscribedHold (Hold x p)
@@ -1346,7 +1312,7 @@ mkWeakPtrWithDebug x debugNote = do
13461312 x' <- evaluate x
13471313 mkWeakPtr x' $
13481314 if debugFinalize
1349− then Just $ debugStrLn $ "finalizing: " ++ debugNote
1315+ then Just $ putStrLn $ "finalizing: " ++ debugNote
13501316 else Nothing
13511317
13521318type WeakList a = [Weak a]
@@ -1368,13 +1334,13 @@ debugSubscriber' description subscribed = Subscriber
13681334 tracePropagate (Proxy :: Proxy x) ("subscriberPropagate: " <> description)
13691335 subscriberPropagate subscribed m
13701336 , subscriberInvalidateHeight = \old -> do
1371− traceInvalidateHeight $ "invalidateSubscriberHeight: " <> description <> ", old = " <> show (unHeight old)
1337+ putStrLn $ "invalidateSubscriberHeight: " <> description <> ", old = " <> show (unHeight old)
13721338 subscriberInvalidateHeight subscribed old
1373− traceInvalidateHeight $ "invalidateSubscriberHeight: " <> description <> ", done"
1339+ putStrLn $ "invalidateSubscriberHeight: " <> description <> ", done"
13741340 , subscriberRecalculateHeight = \new -> do
1375− traceInvalidateHeight $ "subscriberRecalculateHeight: " <> description <> ", new = " <> show (unHeight new)
1341+ putStrLn $ "subscriberRecalculateHeight: " <> description <> ", new = " <> show (unHeight new)
13761342 subscriberRecalculateHeight subscribed new
1377− traceInvalidateHeight $ "subscriberRecalculateHeight: " <> description <> ", done"
1343+ putStrLn $ "subscriberRecalculateHeight: " <> description <> ", done"
13781344 }
13791345
13801346
@@ -1388,15 +1354,11 @@ withIncreasedDepth _ a = do
13881354
13891355{-# INLINE tracePropagate #-}
13901356tracePropagate :: (CanTrace x m) => proxy x -> String -> m ()
1391−tracePropagate p = when debugPropagate . trace p
1357+tracePropagate p = trace p
13921358
13931359{-# INLINE traceInvalidate #-}
13941360traceInvalidate :: String -> IO ()
1395−traceInvalidate = when debugInvalidate . liftIO . debugStrLn
1396−
1397−{-# INLINE traceInvalidateHeight #-}
1398−traceInvalidateHeight :: String -> IO ()
1399−traceInvalidateHeight = when debugInvalidateHeight . liftIO . debugStrLn
1361+traceInvalidate = liftIO . putStrLn
14001362
14011363{-# INLINE trace #-}
14021364trace :: (CanTrace x m) => proxy x -> String -> m ()
@@ -1407,7 +1369,7 @@ traceM :: forall x proxy m. (CanTrace x m) => proxy x -> m String -> m ()
14071369traceM _ getMessage = do
14081370 message <- getMessage
14091371 d <- liftIO $ readIORef $ _spiderTimeline_depth $ unSTE (spiderTimeline :: SpiderTimelineEnv x)
1410− liftIO $ debugStrLn $ replicate d ' ' <> message
1372+ liftIO $ putStrLn $ replicate d ' ' <> message
14111373
14121374#else
14131375
@@ -1423,10 +1385,6 @@ tracePropagate _ _ = return ()
14231385traceInvalidate :: String -> IO ()
14241386traceInvalidate _ = return ()
14251387
1426−{-# INLINE traceInvalidateHeight #-}
1427−traceInvalidateHeight :: String -> IO ()
1428−traceInvalidateHeight _ = return ()
1429−
14301388{-# INLINE debugSubscriber #-}
14311389debugSubscriber :: String -> Subscriber x a -> IO (Subscriber x a)
14321390debugSubscriber _ = return
@@ -1467,11 +1425,8 @@ showStacks :: [[String]] -> String
14671425showStacks = drawForest . listsToForest . fmap (filterStack "Reflex.Spider.Internal")
14681426
14691427filterStack :: String -> [String] -> [String]
1470−#ifdef DEBUG_HIDE_INTERNALS
14711428filterStack prefix = filter (not . (prefix `isPrefixOf`))
1472−#else
1473−filterStack prefix = id
1474−#endif
1429+
14751430
14761431#ifdef DEBUG_CYCLES
14771432
@@ -1498,7 +1453,7 @@ instance Show EventLoopException where
14981453{-# INLINE propagateSubscriberHold #-}
14991454propagateSubscriberHold :: forall x p. (HasSpiderTimeline x, Patch p) => Hold x p -> p -> EventM x ()
15001455propagateSubscriberHold h a = do
1501− {-# SCC "trace" #-} when debugPropagate $ traceM (Proxy :: Proxy x) $ liftIO $ do
1456+ traceM (Proxy :: Proxy x) $ liftIO $ do
15021457 invalidators <- liftIO $ readIORef $ holdInvalidators h
15031458 return $ "SubscriberHold" <> showNodeId h <> ": " ++ show (length invalidators)
15041459
@@ -1506,7 +1461,7 @@ propagateSubscriberHold h a = do
15061461 case {-# SCC "apply" #-} apply a v of
15071462 Nothing -> return ()
15081463 Just v' -> do
1509− {-# SCC "trace2" #-} withIncreasedDepth (Proxy :: Proxy x) $
1464+ withIncreasedDepth (Proxy :: Proxy x) $
15101465 tracePropagate (Proxy :: Proxy x) ("propagateSubscriberHold: assigning Hold" <> showNodeId h)
15111466 vRef <- {-# SCC "vRef" #-} liftIO $ evaluate $ holdValue h
15121467 iRef <- {-# SCC "iRef" #-} liftIO $ evaluate $ holdInvalidators h
@@ -2038,7 +1993,7 @@ revalidateMergeHeight m = do
20381993 LT -> return ()
20391994 EQ -> do
20401995 let height = succHeight $ heightBagMax heights
2041− traceInvalidateHeight $ "recalculateSubscriberHeight: height: " <> show height
1996+ traceInvalidate $ "recalculateSubscriberHeight: height: " <> show height
20421997 writeIORef (_merge_heightRef m) $! height
20431998 subscriberRecalculateHeight (_merge_sub m) height
20441999 GT -> error $ "revalidateMergeHeight: more heights (" <> show (heightBagSize heights) <> ") than parents (" <> show (DMap.size parents) <> ") for Merge"
@@ -2202,7 +2157,7 @@ mergeIntCheap d = Event $ \sub -> do
22022157 LT -> return ()
22032158 EQ -> do
22042159 let height = succHeight $ heightBagMax heights
2205− traceInvalidateHeight $ "recalculateSubscriberHeight: height: " <> show height
2160+ traceInvalidate $ "recalculateSubscriberHeight: height: " <> show height
22062161 writeIORef heightRef $! height
22072162 subscriberRecalculateHeight sub height
22082163 GT -> error $ "revalidateMergeHeight: more heights (" <> show (heightBagSize heights) <> ") than parents (" <> show numParents <> ") for Merge"
@@ -2385,7 +2340,7 @@ runFrame a = SpiderHost $ do
23852340 subscription <- unSpiderHost $ runFrame $ {-# SCC "subscribeSwitch" #-} subscribe e sub --TODO: Assert that the event isn't firing --TODO: This should not loop because none of the events should be firing, but still, it is inefficient
23862341 {-
23872342 stackTrace <- liftIO $ fmap renderStack $ ccsToStrings =<< (getCCSOf $! switchSubscribedParent subscribed)
2388− liftIO $ debugStrLn $ (++stackTrace) $ "subd' subscribed to " ++ case e of
2343+ liftIO $ putStrLn $ (++stackTrace) $ "subd' subscribed to " ++ case e of
23892344 EventRoot _ -> "EventRoot"
23902345 EventNever -> "EventNever"
23912346 _ -> "something else"
@@ -2520,8 +2475,6 @@ instance HasSpiderTimeline x => Reflex.Class.MonadHold (SpiderTimeline x) (Event
25202475 {-# INLINABLE headE #-}
25212476 headE = R.slowHeadE
25222477-- headE (SpiderEvent e) = SpiderEvent <$> Reflex.Spider.Internal.headE e
2523− {-# INLINABLE now #-}
2524− now = nowSpiderEventM
25252478
25262479instance Reflex.Class.MonadSample (SpiderTimeline x) (SpiderPullM x) where
25272480 {-# INLINABLE sample #-}
@@ -2543,9 +2496,6 @@ instance HasSpiderTimeline x => Reflex.Class.MonadHold (SpiderTimeline x) (Spide
25432496 {-# INLINABLE headE #-}
25442497 headE = R.slowHeadE
25452498-- headE (SpiderEvent e) = SpiderPushM $ SpiderEvent <$> Reflex.Spider.Internal.headE e
2546− {-# INLINABLE now #-}
2547− now = SpiderPushM nowSpiderEventM
2548−
25492499
25502500instance HasSpiderTimeline x => Monad (Reflex.Class.Dynamic (SpiderTimeline x)) where
25512501 {-# INLINE return #-}
@@ -2554,10 +2504,8 @@ instance HasSpiderTimeline x => Monad (Reflex.Class.Dynamic (SpiderTimeline x))
25542504 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
25552505 {-# INLINE (>>) #-}
25562506 (>>) = (*>)
2557−#if !MIN_VERSION_base(4,13,0)
25582507 {-# INLINE fail #-}
25592508 fail _ = error "Dynamic does not support 'fail'"
2560−#endif
25612509
25622510{-# INLINABLE newJoinDyn #-}
25632511newJoinDyn :: HasSpiderTimeline x => DynamicS x (Identity (DynamicS x (Identity a))) -> Reflex.Spider.Internal.Dyn x (Identity a)
@@ -2609,9 +2557,6 @@ instance HasSpiderTimeline x => Reflex.Class.MonadHold (SpiderTimeline x) (Spide
26092557 buildDynamic getV0 e = runFrame . runSpiderHostFrame $ Reflex.Class.buildDynamic getV0 e
26102558 {-# INLINABLE headE #-}
26112559 headE e = runFrame . runSpiderHostFrame $ Reflex.Class.headE e
2612− {-# INLINABLE now #-}
2613− now = runFrame . runSpiderHostFrame $ Reflex.Class.now
2614−
26152560
26162561instance HasSpiderTimeline x => Reflex.Class.MonadSample (SpiderTimeline x) (SpiderHostFrame x) where
26172562 sample = SpiderHostFrame . readBehaviorUntracked . unSpiderBehavior --TODO: This can cause problems with laziness, so we should get rid of it if we can
@@ -2628,8 +2573,6 @@ instance HasSpiderTimeline x => Reflex.Class.MonadHold (SpiderTimeline x) (Spide
26282573 {-# INLINABLE headE #-}
26292574 headE = R.slowHeadE
26302575-- headE (SpiderEvent e) = SpiderHostFrame $ SpiderEvent <$> Reflex.Spider.Internal.headE e
2631− {-# INLINABLE now #-}
2632− now = SpiderHostFrame Reflex.Class.now
26332576
26342577instance HasSpiderTimeline x => Reflex.Class.MonadSample (SpiderTimeline x) (SpiderHost x) where
26352578 {-# INLINABLE sample #-}
@@ -2650,8 +2593,6 @@ instance HasSpiderTimeline x => Reflex.Class.MonadHold (SpiderTimeline x) (Refle
26502593 buildDynamic getV0 e = Reflex.Spider.Internal.ReadPhase $ Reflex.Class.buildDynamic getV0 e
26512594 {-# INLINABLE headE #-}
26522595 headE e = Reflex.Spider.Internal.ReadPhase $ Reflex.Class.headE e
2653− {-# INLINABLE now #-}
2654− now = Reflex.Spider.Internal.ReadPhase Reflex.Class.now
26552596
26562597--------------------------------------------------------------------------------
26572598-- Deprecated items
@@ -2775,7 +2716,7 @@ instance HasSpiderTimeline x => R.Reflex (SpiderTimeline x) where
27752716 fanG e = R.EventSelectorG $ SpiderEvent . selectG (fanG (unSpiderEvent e))
27762717 {-# INLINABLE mergeG #-}
27772718 mergeG
2778− :: forall k2 (k :: k2 -> *) q (v :: k2 -> *). GCompare k
2719+ :: forall (k :: k2 -> *) q (v :: k2 -> *). GCompare k
27792720 => (forall a. q a -> R.Event (SpiderTimeline x) (v a))
27802721 -> DMap k q
27812722 -> R.Event (SpiderTimeline x) (DMap k v)
@@ -2843,14 +2784,8 @@ instance Monad (SpiderHost x) where
28432784 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
28442785 {-# INLINABLE return #-}
28452786 return x = SpiderHost $ return x
2846−#if !MIN_VERSION_base(4,13,0)
2847− {-# INLINABLE fail #-}
2848− fail = MonadFail.fail
2849−#endif
2850−
2851−instance MonadFail (SpiderHost x) where
28522787 {-# INLINABLE fail #-}
2853− fail s = SpiderHost $ MonadFail.fail s
2788+ fail s = SpiderHost $ fail s
28542789
28552790-- | Run an action affecting the global Spider timeline; this will be guarded by
28562791-- a mutex for that timeline
@@ -2872,10 +2807,8 @@ instance Monad (SpiderHostFrame x) where
28722807 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
28732808 {-# INLINABLE return #-}
28742809 return x = SpiderHostFrame $ return x
2875−#if !MIN_VERSION_base(4,13,0)
28762810 {-# INLINABLE fail #-}
28772811 fail s = SpiderHostFrame $ fail s
2878−#endif
28792812
28802813instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
28812814 notReadyUntil _ = pure ()