You still create FSM's in functional languages though. Consider:
data Light = On | Off
toggle :: Light -> Light
toggle On = Off
toggle Off = On
So, the data structures represent the possible states, and the associated functions the transitions.
data Light = On | Off
toggle :: Light -> Light
toggle On = Off
toggle Off = On
So, the data structures represent the possible states, and the associated functions the transitions.
No comments yet.