Created
March 23, 2019 21:51
-
-
Save iwilsonq/e6191349fd29ce311f8a3683e01686e4 to your computer and use it in GitHub Desktop.
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
type animal = | |
| Dog | |
| Cat | |
| Octopus; | |
let animalToString = animal => | |
switch(animal) { | |
| Dog => "dog" | |
| Cat => "cat" | |
| Octopus => "octopus" | |
}; | |
let getWelcomeMessage = (name, visits, animal) => { | |
"Hello " ++ | |
name ++ | |
", you've visited this website " ++ | |
string_of_int(visits) ++ | |
" times and your favorite animal is the " ++ | |
animalToString(animal); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment