DEV Community

Discussion on: Is TypeScript Really... A Language??

 
jwp profile image
John Peters

reasonML

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 ++ "."
  };

Now that's refreshing to see.