Personal tools

Yampa/reactimate

From HaskellWiki

< Yampa(Difference between revisions)
Jump to: navigation, search
(New page: 768px (download original Yampa reactimate activity diagram.svg))
 
Line 1: Line 1:
[[Image:Yampa reactimate activity diagram.png‎|768px]]
+
<source lang="Haskell">
(download original [[:Image:Yampa reactimate activity diagram.svg|Yampa reactimate activity diagram.svg]])
+
reactimate :: IO a -- init
  +
-> (Bool -> IO (DTime, Maybe a)) -- input/sense
  +
-> (Bool -> b -> IO Bool) -- output/actuate
  +
-> SF a b -- process/signal function
  +
-> IO ()
  +
</source>
  +
  +
'reactimate' basically is an input-process-output loop. Keep in mind that the signal function may take pretty complex forms like a [[Yampa/Switches|parallel switch]] embedded in a loop.
  +
  +
(The 'Bool' parameter of 'input' and 'output' are unused if you look up the definition of reactimate so just ignore them.)

Revision as of 09:51, 2 July 2011

reactimate :: IO a                          -- init
           -> (Bool -> IO (DTime, Maybe a)) -- input/sense
           -> (Bool -> b -> IO Bool)        -- output/actuate
           -> SF a b                        -- process/signal function
           -> IO ()

'reactimate' basically is an input-process-output loop. Keep in mind that the signal function may take pretty complex forms like a parallel switch embedded in a loop.

(The 'Bool' parameter of 'input' and 'output' are unused if you look up the definition of reactimate so just ignore them.)