Last active
June 23, 2018 00:42
-
-
Save kennetpostigo/b5fa29525cc875329f0914dd92d1469c to your computer and use it in GitHub Desktop.
Reason Phantom Type Animal module type
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
module type Animal = { | |
/* Define abstract types t, dog, and cat */ | |
type t('a); | |
type dog; | |
type cat; | |
/* helpers to create a type dog or cat */ | |
let makeDog: string => t(dog); | |
let makeCat: string => t(cat); | |
let mate: (t('a), t('a)) => string; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment