Created
June 23, 2018 00:51
-
-
Save kennetpostigo/75fe608f737178010259ae6bb4df6d4f to your computer and use it in GitHub Desktop.
Reason Phantom Type Animal catch all usage
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
/* Link to playground: https://bit.ly/2J7t1bR */ | |
let larry = Animal.makeDog("Larry"); | |
let larsa = Animal.makeDog("Larsa"); | |
let mark = Animal.makeCat("Mark"); | |
let marla = Animal.makeCat("Marla"); | |
/* ✅ Mates 2 dogs and then mates 2 cats*/ | |
Js.log(Animal.mate(larry, larsa)); | |
Js.log(Animal.mate(mark, marla)); | |
/* ✅ Mates 1 dog and 1 cats and then 2 cats*/ | |
Js.log(Animal.interMate(larry, marla)); | |
Js.log(Animal.interMate(mark, marla)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment