Reason · Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.
type schoolPerson =
| Teacher
| Director
| Student(string);
let greeting = person =>
switch (person) {
| Teacher => "Hey Professor!"
| Director => "Hello Director."
| Student("Richard") =>
"Still here Ricky?"
| Student(anyOtherName) =>
"Hey, " ++ anyOtherName ++ "."
};
type schoolPerson = Teacher | Director | Student(string);
let greeting = person =>
switch (person) {
| Teacher => "Hey Professor!"
| Director => "Hello Director."
| Student("Richard") => "Still here Ricky?"
| Student(anyOtherName) => "Hey, " ++ anyOtherName ++ "."
};
Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.