@@ -43,6 +43,8 @@ import Control.Monad.Reader.Class
43import Control.Monad.IO.Class
43import Control.Monad.IO.Class
44import Control.Monad.ReaderIO
44import Control.Monad.ReaderIO
45import Control.Monad.Ref
45import Control.Monad.Ref
46+import Control.Monad.Fail (MonadFail)
47+import qualified Control.Monad.Fail as MonadFail
46import Data.Align
48import Data.Align
47import Data.Coerce
49import Data.Coerce
48import Data.Dependent.Map (DMap, DSum (..))
50import Data.Dependent.Map (DMap, DSum (..))
@@ -63,6 +65,7 @@ import Data.Monoid ((<>))
63import Data.Proxy
65import Data.Proxy
64import Data.These
66import Data.These
65import Data.Traversable
67import Data.Traversable
68+import Data.Type.Equality ((:~:)(Refl))
66import Data.Witherable (Filterable, mapMaybe)
69import Data.Witherable (Filterable, mapMaybe)
67import GHC.Exts
70import GHC.Exts
68import GHC.IORef (IORef (..))
71import GHC.IORef (IORef (..))
@@ -972,8 +975,10 @@ instance Monad (BehaviorM x) where
972 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
975 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
973 {-# INLINE return #-}
976 {-# INLINE return #-}
974 return x = BehaviorM $ return x
977 return x = BehaviorM $ return x
978+#if !MIN_VERSION_base(4,13,0)
975 {-# INLINE fail #-}
979 {-# INLINE fail #-}
976 fail s = BehaviorM $ fail s
980 fail s = BehaviorM $ fail s
978data BehaviorSubscribed x a
983data BehaviorSubscribed x a
979 = forall p. BehaviorSubscribedHold (Hold x p)
984 = forall p. BehaviorSubscribedHold (Hold x p)
@@ -2357,8 +2362,10 @@ instance HasSpiderTimeline x => Monad (Reflex.Class.Dynamic (SpiderTimeline x))
2357 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
2362 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
2358 {-# INLINE (>>) #-}
2363 {-# INLINE (>>) #-}
2359 (>>) = (*>)
2364 (>>) = (*>)
2365+#if !MIN_VERSION_base(4,13,0)
2360 {-# INLINE fail #-}
2366 {-# INLINE fail #-}
2361 fail _ = error "Dynamic does not support 'fail'"
2367 fail _ = error "Dynamic does not support 'fail'"
2363{-# INLINABLE newJoinDyn #-}
2370{-# INLINABLE newJoinDyn #-}
2364newJoinDyn :: HasSpiderTimeline x => DynamicS x (Identity (DynamicS x (Identity a))) -> Reflex.Spider.Internal.Dyn x (Identity a)
2371newJoinDyn :: HasSpiderTimeline x => DynamicS x (Identity (DynamicS x (Identity a))) -> Reflex.Spider.Internal.Dyn x (Identity a)
@@ -2637,8 +2644,14 @@ instance Monad (SpiderHost x) where
2637 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
2644 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
2638 {-# INLINABLE return #-}
2645 {-# INLINABLE return #-}
2639 return x = SpiderHost $ return x
2646 return x = SpiderHost $ return x
2647+#if !MIN_VERSION_base(4,13,0)
2648+ {-# INLINABLE fail #-}
2649+ fail = MonadFail.fail
2652+instance MonadFail (SpiderHost x) where
2640 {-# INLINABLE fail #-}
2653 {-# INLINABLE fail #-}
2641− fail s = SpiderHost $ fail s
2654+ fail s = SpiderHost $ MonadFail.fail s
2643-- | Run an action affecting the global Spider timeline; this will be guarded by
2656-- | Run an action affecting the global Spider timeline; this will be guarded by
2644-- a mutex for that timeline
2657-- a mutex for that timeline
@@ -2660,8 +2673,10 @@ instance Monad (SpiderHostFrame x) where
2660 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
2673 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
2661 {-# INLINABLE return #-}
2674 {-# INLINABLE return #-}
2662 return x = SpiderHostFrame $ return x
2675 return x = SpiderHostFrame $ return x
2676+#if !MIN_VERSION_base(4,13,0)
2663 {-# INLINABLE fail #-}
2677 {-# INLINABLE fail #-}
2664 fail s = SpiderHostFrame $ fail s
2678 fail s = SpiderHostFrame $ fail s
2666instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
2681instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
2667 notReadyUntil _ = pure ()
2682 notReadyUntil _ = pure ()