Example 2: Door with Pin

Full source code: test/Examples/DoorPin.purs

Now let’s extend our door to support PIN-based locking. In this enhanced version, you can lock the door with a PIN code, and then only unlock it by entering the correct PIN. This introduces two important concepts: states with data and conditional transitions.

↑ Back to top