Last active
June 23, 2018 00:51
-
-
Save kennetpostigo/06c750df962feead940df54a8535a7ea to your computer and use it in GitHub Desktop.
Reason Phantom Type Animal 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/2IUSbXw */ | |
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)); | |
/* 🛑Errors with 1 dog 1 cat when uncommented at compile time */ | |
/* Js.log(Animal.mate(larry, marla)); */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment