Created
July 19, 2018 21:59
-
-
Save kennetpostigo/9a3ab145ce462247f352ee469822801f to your computer and use it in GitHub Desktop.
NotAbstract example from Universal and Existential Types in ReasonML blogpost
This file contains hidden or 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/2uCBISK */ | |
module type Animal = { | |
type t = string; | |
let make: (string) => t; | |
let sprint: (t) => string; | |
}; | |
module Animal: Animal = { | |
type t = string; | |
let make = (name) => name; | |
let sprint = a => {j|$a is running!|j}; | |
}; | |
let pwned = "pwned"; | |
Js.log(Animal.sprint(pwned)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment