@@ -22,6 +22,7 @@ import Data.Maybe
2222import Data.IntMap (IntMap)
2323import qualified Data.IntMap as IntMap
2424import Control.Monad.Ref
25+import Control.Monad.Exception
2526import Data.Monoid ((<>))
2627
2728import System.IO.Unsafe
@@ -223,7 +224,7 @@ data Root a
223224data SomeHoldInit = forall a. SomeHoldInit (Event a) (Hold a)
224225
225226-- EventM can do everything BehaviorM can, plus create holds
226−newtype EventM a = EventM { unEventM :: ReaderT EventEnv IO a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO) -- The environment should be Nothing if we are not in a frame, and Just if we are - in which case it is a list of assignments to be done after the frame is over
227+newtype EventM a = EventM { unEventM :: ReaderT EventEnv IO a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadException, MonadAsyncException) -- The environment should be Nothing if we are not in a frame, and Just if we are - in which case it is a list of assignments to be done after the frame is over
227228
228229data PushSubscribed a b
229230 = PushSubscribed { pushSubscribedOccurrence :: !(IORef (Maybe b)) -- If the current height is less than our height, this should always be Nothing; during our height, this will get filled in at some point, always before our children are notified; after our height, this will be filled in with the correct value (Nothing if we are not firing, Just if we are)
@@ -1345,9 +1346,9 @@ instance MonadAtomicRef EventM where
13451346 {-# INLINE atomicModifyRef #-}
13461347 atomicModifyRef r f = liftIO $ atomicModifyRef r f
13471348
1348−newtype SpiderHost a = SpiderHost { runSpiderHost :: IO a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO)
1349+newtype SpiderHost a = SpiderHost { runSpiderHost :: IO a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadException, MonadAsyncException)
13491350
1350−newtype SpiderHostFrame a = SpiderHostFrame { runSpiderHostFrame :: EventM a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO)
1351+newtype SpiderHostFrame a = SpiderHostFrame { runSpiderHostFrame :: EventM a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadException, MonadAsyncException)
13511352
13521353instance R.MonadSample Spider SpiderHostFrame where
13531354 sample = SpiderHostFrame . R.sample --TODO: This can cause problems with laziness, so we should get rid of it if we can