Skip to content

Instantly share code, notes, and snippets.

@peterpme
Created May 13, 2020 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterpme/10840585ddced15a7f4ecd05394e6091 to your computer and use it in GitHub Desktop.
Save peterpme/10840585ddced15a7f4ecd05394e6091 to your computer and use it in GitHub Desktop.
ReasonML Pattern Matching
type action = Toggle | Close | Edit;
let reducer = switch(action) {
| Toggle => "toggle visibility"
| Close => "close me"
| Edit => "edit function"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment