Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type BehaviorFExcept m td a b e = BehaviourFExcept m td a b e
- type BehaviourFExcept m td a b e = forall cl. td ~ TimeDomainOf cl => SyncExcept m cl a b e
- type SyncExcept m cl a b e = MSFExcept (ReaderT (TimeInfo cl) m) a b e
- commuteExceptReader :: ExceptT e (ReaderT r m) a -> ReaderT r (ExceptT e m) a
- runSyncExcept :: Monad m => SyncExcept m cl a b e -> SyncSF (ExceptT e m) cl a b
- try :: Monad m => SyncSF (ExceptT e m) cl a b -> SyncExcept m cl a b e
- once :: Monad m => (a -> m e) -> SyncExcept m cl a b e
- once_ :: Monad m => m e -> SyncExcept m cl a b e
- throwS :: Monad m => SyncSF (ExceptT e m) cl e a
- throwOn :: Monad m => e -> SyncSF (ExceptT e m) cl Bool ()
- throwOn' :: Monad m => SyncSF (ExceptT e m) cl (Bool, e) ()
- step :: Monad m => (a -> m (b, e)) -> SyncExcept m cl a b e
- keepFirst :: Monad m => SyncSF m cl a a
- timer :: (Monad m, TimeDomain td, Ord (Diff td)) => Diff td -> BehaviorF (ExceptT () m) td a (Diff td)
- scaledTimer :: (Monad m, TimeDomain td, Fractional (Diff td), Ord (Diff td)) => Diff td -> BehaviorF (ExceptT () m) td a (Diff td)
- module Control.Monad.Trans.Except
- safe :: Monad m => MSF m a b -> MSFExcept m a b e
- safely :: Monad m => MSFExcept m a b Empty -> MSF m a b
- data Empty
- exceptS :: Monad m => MSF (ExceptT e m) a b -> MSF m a (Either e b)
- runMSFExcept :: MSFExcept m a b e -> MSF (ExceptT e m) a b
Documentation
type BehaviorFExcept m td a b e = BehaviourFExcept m td a b e Source #
Compatibility to U.S. american spelling.
type BehaviourFExcept m td a b e = forall cl. td ~ TimeDomainOf cl => SyncExcept m cl a b e Source #
A clock polymorphic SyncExcept
.
Any clock with time domain td
may occur.
type SyncExcept m cl a b e = MSFExcept (ReaderT (TimeInfo cl) m) a b e Source #
A synchronous exception-throwing signal function.
It is based on a newtype
, MSFExcept
,
to exhibit a monad interface in the exception type.
return
then corresponds to throwing an exception,
and `(>>=)` is exception handling.
(For more information, see the documentation of MSFExcept
.)
m
: The monad that the signal function may take side effects incl
: The clock on which the signal function ticksa
: The input typeb
: The output typee
: The type of exceptions that can be thrown
runSyncExcept :: Monad m => SyncExcept m cl a b e -> SyncSF (ExceptT e m) cl a b Source #
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.
The SyncSF
will be run until it encounters an exception.
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 #
Immediately throw the exception on the input.
throwOn :: Monad m => e -> SyncSF (ExceptT e m) cl Bool () Source #
Throw the given exception when the Bool
turns true.
throwOn' :: Monad m => SyncSF (ExceptT e m) cl (Bool, e) () Source #
Variant of throwOn
, where the exception can vary every tick.
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.
module Control.Monad.Trans.Except
runMSFExcept :: MSFExcept m a b e -> MSF (ExceptT e m) a b #