This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (main) | |
{- | |
Can we make impossible state transtions impossible as impossible state can be impossible? | |
An order has this state machine: Initial -> { Processing, Cancelled }, Processing -> {Cancelled, Shipping}, | |
Shipping -> {Shipped, Lost}. So end states are Cancelled, Shipped and Lost. | |
Let's see if can make the compiler catch when trying to cancel an order that is shipping. |