Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type TestGuestConstraints t (m :: Type -> Type) = (MonadReflexHost t m, MonadHold t m, MonadSample t m, Ref m ~ Ref IO, MonadRef m, MonadRef (HostFrame t), Ref (HostFrame t) ~ Ref IO, MonadIO (HostFrame t), MonadIO m, MonadFix m)
- type TestGuestMonad t (m :: Type -> Type) = PostBuildT t (PerformEventT t m)
- data AppIn t b e = AppIn {
- _appIn_behavior :: Behavior t b
- _appIn_event :: Event t e
- data AppOut t b e = AppOut {
- _appOut_behavior :: Behavior t b
- _appOut_event :: Event t e
- data AppFrame t bIn eIn bOut eOut m = AppFrame {
- _appFrame_readPhase :: ReadPhase m (bOut, Maybe eOut)
- _appFrame_mpulseB :: Maybe (EventTrigger t bIn)
- _appFrame_mpulseE :: Maybe (EventTrigger t eIn)
- _appFrame_fire :: forall a. [DSum (EventTrigger t) Identity] -> ReadPhase m a -> m [a]
- getAppFrame :: forall t bIn eIn bOut eOut m. TestGuestConstraints t m => (AppIn t bIn eIn -> TestGuestMonad t m (AppOut t bOut eOut)) -> bIn -> m (AppFrame t bIn eIn bOut eOut m)
- tickAppFrame :: AppFrame t bIn eIn bOut eOut m -> Maybe (These bIn eIn) -> m [(bOut, Maybe eOut)]
- runAppSimple :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (Event t eIn -> TestGuestMonad t m (Event t eOut)) -> [eIn] -> IO [[Maybe eOut]]
- runApp :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (AppIn t bIn eIn -> TestGuestMonad t m (AppOut t bOut eOut)) -> bIn -> [Maybe (These bIn eIn)] -> IO [[(bOut, Maybe eOut)]]
- runApp' :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (Event t eIn -> TestGuestMonad t m (Event t eOut)) -> [Maybe eIn] -> IO [[Maybe eOut]]
- runAppB :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (Event t eIn -> TestGuestMonad t m (Behavior t bOut)) -> [Maybe eIn] -> IO [[bOut]]
Documentation
type TestGuestConstraints t (m :: Type -> Type) = (MonadReflexHost t m, MonadHold t m, MonadSample t m, Ref m ~ Ref IO, MonadRef m, MonadRef (HostFrame t), Ref (HostFrame t) ~ Ref IO, MonadIO (HostFrame t), MonadIO m, MonadFix m) Source #
type TestGuestMonad t (m :: Type -> Type) = PostBuildT t (PerformEventT t m) Source #
AppIn | |
|
AppOut | |
|
data AppFrame t bIn eIn bOut eOut m Source #
AppFrame | |
|
getAppFrame :: forall t bIn eIn bOut eOut m. TestGuestConstraints t m => (AppIn t bIn eIn -> TestGuestMonad t m (AppOut t bOut eOut)) -> bIn -> m (AppFrame t bIn eIn bOut eOut m) Source #
tickAppFrame :: AppFrame t bIn eIn bOut eOut m -> Maybe (These bIn eIn) -> m [(bOut, Maybe eOut)] Source #
Tick an app frame once with optional input behavior and event values.
Returns behaviors and events from the app's output for each frame that run
for the input (i.e. runWithAdjust
and performEvent
may cause several
frames to run for each input)
N.B. output behavior will not reflect changes that happen during its frame
i.e. this is analogous to tag
and tagPromptlyDyn
. If you need the most
recent behavior value you can always call tickAppFrame
with Nothing
as
input
runAppSimple :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (Event t eIn -> TestGuestMonad t m (Event t eOut)) -> [eIn] -> IO [[Maybe eOut]] Source #
run an app with provided list of input events returns list of results for
each input. Each result is a list of events from the app's output for each
frame that run for the input.
see comments for tickAppFrame
runApp :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (AppIn t bIn eIn -> TestGuestMonad t m (AppOut t bOut eOut)) -> bIn -> [Maybe (These bIn eIn)] -> IO [[(bOut, Maybe eOut)]] Source #
calls tickAppFrame
for each input in a list and returns collected results
see comments for tickAppFrame
runApp' :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (Event t eIn -> TestGuestMonad t m (Event t eOut)) -> [Maybe eIn] -> IO [[Maybe eOut]] Source #
same as runAppSimple except input event for each frame is optional
see comments for tickAppFrame
runAppB :: (t ~ SpiderTimeline Global, m ~ SpiderHost Global) => (Event t eIn -> TestGuestMonad t m (Behavior t bOut)) -> [Maybe eIn] -> IO [[bOut]] Source #
same as runApp' except only returns sampled output behavior
see comments for tickAppFrame