Skip to content

Instantly share code, notes, and snippets.

@kennetpostigo
Last active June 25, 2018 14:56
Show Gist options
  • Save kennetpostigo/3cb15b6e5702c3fcd50454b94d7b065d to your computer and use it in GitHub Desktop.
Save kennetpostigo/3cb15b6e5702c3fcd50454b94d7b065d to your computer and use it in GitHub Desktop.
Reason BST Blog Post types
/* waddup annotated as a string */
let waddup: string = "waddup fam?!?!";
/* greeting annotated as a function that takes a string and returns string */
let greeting: string => string = name => "Hey " ++ name ++ "!";
/* Type constructor for a function that takes a string and returns unit */
type nonPureGreeting = string => unit;
/* printGreet annotated as nonPureGreeting*/
let printGreet: nonPureGreeting = name => print_string(greet(name));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment