Applicative instances for different types of automata (finite state machines, pushdown automata, and queue automata)