-- | Program stateful abstract fudgets in a monadic style
module ReactiveF(reactiveF,reactiveSP,module ReactionM) where
import Fudgets
import ReactionM

reactiveF :: (a -> ReactionM t b a2) -> t -> F a b
reactiveF  = (t -> a -> (t, [b])) -> t -> F a b
forall t a b. (t -> a -> (t, [b])) -> t -> F a b
mapstateF  ((t -> a -> (t, [b])) -> t -> F a b)
-> ((a -> ReactionM t b a2) -> t -> a -> (t, [b]))
-> (a -> ReactionM t b a2)
-> t
-> F a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> ReactionM t b a2) -> t -> a -> (t, [b])
forall t a1 o a2. (t -> ReactionM a1 o a2) -> a1 -> t -> (a1, [o])
mf
reactiveSP :: (a -> ReactionM t b a2) -> t -> SP a b
reactiveSP = (t -> a -> (t, [b])) -> t -> SP a b
forall t a b. (t -> a -> (t, [b])) -> t -> SP a b
mapstateSP ((t -> a -> (t, [b])) -> t -> SP a b)
-> ((a -> ReactionM t b a2) -> t -> a -> (t, [b]))
-> (a -> ReactionM t b a2)
-> t
-> SP a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> ReactionM t b a2) -> t -> a -> (t, [b])
forall t a1 o a2. (t -> ReactionM a1 o a2) -> a1 -> t -> (a1, [o])
mf

mf :: (t -> ReactionM a1 o a2) -> a1 -> t -> (a1, [o])
mf t -> ReactionM a1 o a2
rM a1
s t
m = ReactionM a1 o a2 -> a1 -> (a1, [o])
forall a1 o a2. ReactionM a1 o a2 -> a1 -> (a1, [o])
react (t -> ReactionM a1 o a2
rM t
m) a1
s