Last active
March 23, 2018 12:13
-
-
Save amrza/a2c6876736beb2194225712cfba7d6b3 to your computer and use it in GitHub Desktop.
reasonml
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
type schoolPerson = Teacher | Director; | |
let greeting = (stranger) => | |
switch (stranger) { | |
| Teacher => "Hey professor!" | |
| Director => "Hello director." | |
}; | |
Js.log(greeting(Teacher)); | |
------------------- | |
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE | |
'use strict'; | |
function greeting(stranger) { | |
if (stranger !== 0) { | |
return "Hello director."; | |
} else { | |
return "Hey professor!"; | |
} | |
} | |
console.log("Hey professor!"); | |
exports.greeting = greeting; | |
/* Not a pure module */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment