There's a nice example from Shriram Krishnamurthi of implementing automata using functions, where the functions represent states and state transitions are just function calls. It's an elegant way of creating automata IMHO, but the efficiency of the approach depends on TCO:
http://cs.brown.edu/~sk/Publications/Papers/Published/sk-aut...