@@ -19,6 +19,7 @@ import Control.Monad hiding (mapM, mapM_, forM, forM_, sequence, sequence_)
1919import Control.Monad.Reader hiding (mapM, mapM_, forM, forM_, sequence, sequence_)
2020import Control.Monad.Ref
2121import Control.Monad.State.Strict hiding (mapM, mapM_, forM, forM_, sequence, sequence_, get)
22+import Control.Monad.Exception
2223import Control.Concurrent
2324import Control.Applicative
2425import Data.ByteString (ByteString)
@@ -37,7 +38,7 @@ data GuiEnv t h
3738 }
3839
3940--TODO: Poorly named
40−newtype Gui t h m a = Gui { unGui :: ReaderT (GuiEnv t h) m a } deriving (Functor, Applicative, Monad, MonadIO, MonadFix)
41+newtype Gui t h m a = Gui { unGui :: ReaderT (GuiEnv t h) m a } deriving (Functor, Applicative, Monad, MonadIO, MonadFix, MonadException, MonadAsyncException)
4142
4243runGui :: Gui t h m a -> GuiEnv t h -> m a
4344runGui (Gui g) env = runReaderT g env
@@ -108,7 +109,7 @@ type WidgetInternal t m a = ReaderT WidgetEnv (StateT (WidgetState t m) m) a
108109instance MonadTrans (Widget t) where
109110 lift = Widget . lift . lift
110111
111−newtype Widget t m a = Widget { unWidget :: WidgetInternal t m a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO)
112+newtype Widget t m a = Widget { unWidget :: WidgetInternal t m a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadException, MonadAsyncException)
112113
113114instance MonadSample t m => MonadSample t (Widget t m) where
114115 sample b = lift $ sample b
@@ -133,7 +134,7 @@ instance MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (Widget t m)
133134 newEventWithTrigger = lift . newEventWithTrigger
134135
135136instance ( MonadRef m, Ref m ~ Ref IO, MonadRef h, Ref h ~ Ref IO --TODO: Shouldn't need to be IO
136− , MonadIO m, MonadIO h, Functor m
137+ , MonadIO m, MonadAsyncException m, MonadIO h, MonadAsyncException h, Functor m
137138 , ReflexHost t, MonadReflexCreateTrigger t m, MonadSample t m, MonadHold t m
138139 , MonadFix m, HasWebView h, HasPostGui t h h
139140 ) => MonadWidget t (Widget t (Gui t h m)) where
@@ -195,7 +196,7 @@ mainWidgetWithCss css w = runWebGUI $ \webView -> do
195196 Just body <- documentGetBody doc
196197 attachWidget body webView w
197198
198−newtype WithWebView m a = WithWebView { unWithWebView :: ReaderT WebView m a } deriving (Functor, Applicative, Monad, MonadIO, MonadFix)
199+newtype WithWebView m a = WithWebView { unWithWebView :: ReaderT WebView m a } deriving (Functor, Applicative, Monad, MonadIO, MonadFix, MonadException, MonadAsyncException)
199200
200201instance (Monad m) => HasWebView (WithWebView m) where
201202 askWebView = WithWebView ask