Finite-State Machines, Part 2: Explicit Typed State Transitions

from blog Oskar Wickström, | ↗ original
In the first part of this series, we left off having made states explicit using Haskell data types. We concluded that state transitions were implicit, and that a mistake in implementation, making an erroneous state transition, would not be caught by the type system. We also noted that side effects performed at state transitions complicated...