Created
September 30, 2017 15:35
-
-
Save wildeyes/da93878a72c785b089d64bcd2799ba7b to your computer and use it in GitHub Desktop.
The Elm Switch (Case Of) Statement + Destructuring (Pattern Matching)
This file contains hidden or 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
type User | |
= Activated | |
| Deleted | |
update state = | |
case state of | |
Activated -> | |
-- do something | |
Deleted -> | |
-- do again |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment