-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Arrowized functional state machines
--
-- Arrowized functional state machines. This module is inspired by Yampa
-- and the paper Functional Reactive Programming, Continued*
-- written by Henrik Nilsson, Antony Courtney and John Peterson.
@package AFSM
@version 0.1.1.3
module Control.AFSM.Event
data Event a
E :: a -> Event a
NoE :: Event a
ErrE :: String -> Event a
ExitE :: Event a
instance GHC.Classes.Ord a => GHC.Classes.Ord (Control.AFSM.Event.Event a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Control.AFSM.Event.Event a)
instance GHC.Show.Show a => GHC.Show.Show (Control.AFSM.Event.Event a)
-- | Arrowized functional state machines.
--
-- This module is inspired by Yampa and the paper Functional Reactive
-- Programming, Continued* written by Henrik Nilsson, Antony Courtney
-- and John Peterson.
module Control.AFSM
data Event a
E :: a -> Event a
NoE :: Event a
ErrE :: String -> Event a
ExitE :: Event a
-- | SM is a type representing a state machine.
data SM a b
type SMState s a b = s -> a -> (SM a b, b)
-- | newSM is the same with SM constructor.
newSM :: s -> (SMState s a b) -> SM a b
-- | simpleSM is to build a simple SM which have only one SMState.
simpleSM :: s -> (s -> a -> (s, b)) -> SM a b
-- | constSM build a SM which always return b
constSM :: b -> SM a b
-- | execSM converts SM a b -> SM [a] [b], it is very useful to compose
-- SM a [b] and SM b c to SM a [c].
execSM :: SM a b -> SM [a] [b]
-- | execute SM a b with input [a].
exec :: SM a b -> [a] -> (SM a b, [b])
instance Control.Category.Category Control.AFSM.SM
instance Control.Arrow.Arrow Control.AFSM.SM
instance Control.Arrow.ArrowChoice Control.AFSM.SM
instance Control.Arrow.ArrowLoop Control.AFSM.SM