Skip to content

Instantly share code, notes, and snippets.

@kennetpostigo
Created July 19, 2018 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennetpostigo/9a3ab145ce462247f352ee469822801f to your computer and use it in GitHub Desktop.
Save kennetpostigo/9a3ab145ce462247f352ee469822801f to your computer and use it in GitHub Desktop.
NotAbstract example from Universal and Existential Types in ReasonML blogpost
/* 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