reflex 0.9.1.0 → 0.9.2.0
raw patch · 12 files changed
+59/−12 lines, 12 filesdep +exceptions
Dependencies added: exceptions
Files
- ChangeLog.md +4/−0
- reflex.cabal +2/−1
- src/Reflex/BehaviorWriter/Base.hs +4/−0
- src/Reflex/DynamicWriter/Base.hs +4/−0
- src/Reflex/EventWriter/Base.hs +4/−0
- src/Reflex/Host/Headless.hs +10/−6
- src/Reflex/PerformEvent/Base.hs +4/−0
- src/Reflex/PostBuild/Base.hs +15/−1
- src/Reflex/Query/Base.hs +2/−1
- src/Reflex/Requester/Base/Internal.hs +4/−0
- src/Reflex/Spider/Internal.hs +4/−2
- src/Reflex/TriggerEvent/Base.hs +2/−1
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for reflex +## 0.9.2.0++* Add MonadMask, MonadCatch, MonadThrow instances+ ## 0.9.1.0 * Headless Host: Add some MonadSample, MonadHold, and MonadFix instances
reflex.cabal view
@@ -1,5 +1,5 @@ Name: reflex-Version: 0.9.1.0+Version: 0.9.2.0 Synopsis: Higher-order Functional Reactive Programming Description: Interactive programs without callbacks or side-effects.@@ -80,6 +80,7 @@ containers >= 0.6 && < 0.7, data-default >= 0.5 && < 0.8, dependent-map >= 0.3 && < 0.5,+ exceptions >= 0.10 && < 0.11, exception-transformers >= 0.4 && < 0.5, lens >= 4.7 && < 5.3, mmorph >= 1.0 && < 1.3,
src/Reflex/BehaviorWriter/Base.hs view
@@ -22,6 +22,7 @@ ) where import Control.Monad+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Identity@@ -62,6 +63,9 @@ , MonadFix , MonadAsyncException , MonadException+ , MonadCatch+ , MonadThrow+ , MonadMask ) -- | Run a 'BehaviorWriterT' action. The behavior writer output will be provided
src/Reflex/DynamicWriter/Base.hs view
@@ -20,6 +20,7 @@ ) where import Control.Monad+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Identity@@ -101,6 +102,9 @@ , MonadFix , MonadAsyncException , MonadException+ , MonadCatch+ , MonadThrow+ , MonadMask ) deriving instance MonadHold t m => MonadHold t (DynamicWriterT t w m)
src/Reflex/EventWriter/Base.hs view
@@ -33,6 +33,7 @@ import Reflex.Requester.Class import Reflex.TriggerEvent.Class +import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Identity@@ -109,6 +110,9 @@ , MonadIO , MonadException , MonadAsyncException+ , MonadMask+ , MonadCatch+ , MonadThrow ) -- | Run a 'EventWriterT' action.
src/Reflex/Host/Headless.hs view
@@ -8,6 +8,7 @@ import Control.Concurrent.Chan (newChan, readChan) import Control.Monad (unless)+import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) import Control.Monad.Fix (MonadFix, fix) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Primitive (PrimMonad)@@ -23,26 +24,29 @@ import Reflex.Host.Class type MonadHeadlessApp t m =- ( Adjustable t m+ ( Reflex t+ , Adjustable t m+ , MonadCatch m+ , MonadFix (Performable m) , MonadFix m+ , MonadHold t (Performable m) , MonadHold t m , MonadIO (HostFrame t) , MonadIO (Performable m) , MonadIO m+ , MonadMask m , MonadRef (HostFrame t)+ , MonadSample t (Performable m)+ , MonadSample t m+ , MonadThrow m , NotReady t m , PerformEvent t m , PostBuild t m , PrimMonad (HostFrame t) , Ref (HostFrame t) ~ IORef , Ref m ~ IORef- , Reflex t , ReflexHost t , TriggerEvent t m- , MonadSample t (Performable m)- , MonadSample t m- , MonadFix (Performable m)- , MonadHold t (Performable m) ) -- | Run a headless FRP network. Inside the action, you will most probably use
src/Reflex/PerformEvent/Base.hs view
@@ -32,6 +32,7 @@ import Reflex.Requester.Class import Control.Lens+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Identity@@ -64,6 +65,9 @@ deriving instance (ReflexHost t, MonadException (HostFrame t)) => MonadException (PerformEventT t m) deriving instance (ReflexHost t, Monoid a) => Monoid (PerformEventT t m a) deriving instance (ReflexHost t, S.Semigroup a) => S.Semigroup (PerformEventT t m a)+deriving instance (ReflexHost t, MonadCatch (HostFrame t)) => MonadCatch (PerformEventT t m)+deriving instance (ReflexHost t, MonadThrow (HostFrame t)) => MonadThrow (PerformEventT t m)+deriving instance (ReflexHost t, MonadMask (HostFrame t)) => MonadMask (PerformEventT t m) instance (PrimMonad (HostFrame t), ReflexHost t) => PrimMonad (PerformEventT t m) where type PrimState (PerformEventT t m) = PrimState (HostFrame t)
src/Reflex/PostBuild/Base.hs view
@@ -29,6 +29,7 @@ import Reflex.TriggerEvent.Class import Control.Applicative (liftA2)+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Identity@@ -44,7 +45,20 @@ import qualified Data.Semigroup as S -- | Provides a basic implementation of 'PostBuild'.-newtype PostBuildT t m a = PostBuildT { unPostBuildT :: ReaderT (Event t ()) m a } deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadTrans, MonadException, MonadAsyncException)+newtype PostBuildT t m a = PostBuildT { unPostBuildT :: ReaderT (Event t ()) m a }+ deriving+ ( Functor+ , Applicative+ , Monad+ , MonadFix+ , MonadIO+ , MonadTrans+ , MonadException+ , MonadAsyncException+ , MonadMask+ , MonadThrow+ , MonadCatch+ ) -- | Run a 'PostBuildT' action. An 'Event' should be provided that fires -- immediately after the action is finished running; no other 'Event's should
src/Reflex/Query/Base.hs view
@@ -20,6 +20,7 @@ ) where import Control.Applicative (liftA2)+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Morph@@ -60,7 +61,7 @@ import Reflex.TriggerEvent.Class newtype QueryT t q m a = QueryT { unQueryT :: StateT [Behavior t q] (EventWriterT t q (ReaderT (Dynamic t (QueryResult q)) m)) a }- deriving (Functor, Applicative, Monad, MonadException, MonadFix, MonadIO, MonadAtomicRef)+ deriving (Functor, Applicative, Monad, MonadException, MonadFix, MonadIO, MonadAtomicRef, MonadCatch, MonadThrow, MonadMask) deriving instance MonadHold t m => MonadHold t (QueryT t q m) deriving instance MonadSample t m => MonadSample t (QueryT t q m)
src/Reflex/Requester/Base/Internal.hs view
@@ -33,6 +33,7 @@ import Control.Applicative (liftA2) import Control.Monad+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Identity@@ -277,6 +278,9 @@ #if MIN_VERSION_base(4,9,1) , MonadAsyncException #endif+ , MonadCatch+ , MonadThrow+ , MonadMask ) deriving instance MonadSample t m => MonadSample t (RequesterT t request response m)
src/Reflex/Spider/Internal.hs view
@@ -35,6 +35,7 @@ import Control.Concurrent import Control.Exception import Control.Monad hiding (forM, forM_, mapM, mapM_)+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Identity hiding (forM, forM_, mapM, mapM_)@@ -1058,7 +1059,8 @@ newtype SomeMergeInit x = SomeMergeInit { unSomeMergeInit :: EventM x () } -- EventM can do everything BehaviorM can, plus create holds-newtype EventM x a = EventM { unEventM :: IO a } deriving (Functor, Applicative, Monad, MonadIO, MonadFix, MonadException, MonadAsyncException)+newtype EventM x a = EventM { unEventM :: IO a }+ deriving (Functor, Applicative, Monad, MonadIO, MonadFix, MonadException, MonadAsyncException, MonadCatch, MonadThrow, MonadMask) newtype MergeSubscribedParent x a = MergeSubscribedParent { unMergeSubscribedParent :: EventSubscription x } @@ -2864,7 +2866,7 @@ runSpiderHostForTimeline (SpiderHost a) _ = a newtype SpiderHostFrame (x :: Type) a = SpiderHostFrame { runSpiderHostFrame :: EventM x a }- deriving (Functor, Applicative, MonadFix, MonadIO, MonadException, MonadAsyncException)+ deriving (Functor, Applicative, MonadFix, MonadIO, MonadException, MonadAsyncException, MonadMask, MonadThrow, MonadCatch) instance Monad (SpiderHostFrame x) where {-# INLINABLE (>>=) #-}
src/Reflex/TriggerEvent/Base.hs view
@@ -15,6 +15,7 @@ import Control.Applicative (liftA2) import Control.Concurrent+import Control.Monad.Catch (MonadMask, MonadThrow, MonadCatch) import Control.Monad.Exception import Control.Monad.Fix import Control.Monad.Primitive@@ -41,7 +42,7 @@ -- | A basic implementation of 'TriggerEvent'. newtype TriggerEventT t m a = TriggerEventT { unTriggerEventT :: ReaderT (Chan [DSum (EventTriggerRef t) TriggerInvocation]) m a }- deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadException, MonadAsyncException)+ deriving (Functor, Applicative, Monad, MonadFix, MonadIO, MonadException, MonadAsyncException, MonadCatch, MonadThrow, MonadMask) -- | Run a 'TriggerEventT' action. The argument should be a 'Chan' into which -- 'TriggerInvocation's can be passed; it is expected that some other thread