rhine-0.3.0.0: Functional Reactive Programming with type-level clocks

Safe HaskellNone
LanguageHaskell2010

FRP.Rhine.SyncSF.Except

Synopsis

Documentation

type SyncExcept m cl a b e = MSFExcept (ReaderT (TimeInfo cl) m) a b e Source #

type BehaviourFExcept m td a b e = forall cl. td ~ TimeDomainOf cl => SyncExcept m cl a b e Source #

type BehaviorFExcept m td a b e = BehaviourFExcept m td a b e Source #

Compatibility to U.S. american spelling.

commuteReaderExcept :: ReaderT r (ExceptT e m) a -> ExceptT e (ReaderT r m) a Source #

Commute the effects of the |ReaderT| and the |ExceptT| monad.

try :: Monad m => SyncSF (ExceptT e m) cl a b -> SyncExcept m cl a b e Source #

Enter the monad context in the exception for |SyncSF|s in the |ExceptT| monad.

once :: Monad m => (a -> m e) -> SyncExcept m cl a b e Source #

Within the same tick, perform a monadic action, and immediately throw the value as an exception.

once_ :: Monad m => m e -> SyncExcept m cl a b e Source #

A variant of |once| without input.

throwS :: Monad m => SyncSF (ExceptT e m) cl e a Source #

throwOn' :: Monad m => SyncSF (ExceptT e m) cl (Bool, e) () Source #

throwOn :: Monad m => e -> SyncSF (ExceptT e m) cl Bool () Source #

step :: Monad m => (a -> m (b, e)) -> SyncExcept m cl a b e Source #

Advances a single tick with the given Kleisli arrow, and then throws an exception.

keepFirst :: Monad m => SyncSF m cl a a Source #

Remembers and indefinitely outputs the first input value.

timer :: (Monad m, TimeDomain td, Ord (Diff td)) => Diff td -> BehaviorF (ExceptT () m) td a (Diff td) Source #

Throws an exception after the specified time difference, outputting the remaining time difference.

scaledTimer :: (Monad m, TimeDomain td, Fractional (Diff td), Ord (Diff td)) => Diff td -> BehaviorF (ExceptT () m) td a (Diff td) Source #

Like timer, but divides the remaining time by the total time.

safe :: Monad m => MSF m a b -> MSFExcept m a b e #

An MSF without an ExceptT layer never throws an exception, and can thus have an arbitrary exception type.

safely :: Monad m => MSFExcept m a b Empty -> MSF m a b #

If no exception can occur, the MSF can be executed without the ExceptT layer.

data Empty :: * #

The empty type. As an exception type, it encodes "no exception possible".

exceptS :: Monad m => MSF (ExceptT e m) a b -> MSF m a (Either e b) #

Escape an ExceptT layer by outputting the exception whenever it occurs. If an exception occurs, the current MSF continuation is tested again on the next input.

runMSFExcept :: MSFExcept m a b e -> MSF (ExceptT e m) a b #