Content deleted Content added
Citation bot (talk | contribs) Altered template type. Added newspaper. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by Dominic3203 | Category:Pattern matching programming languages | #UCB_Category 9/30 |
Add example code |
||
Line 27:
BuckleScript was forked to Melange<ref>{{Cite web |date=2023-06-02 |title=ANN: Melange 1.0 – compile OCaml / ReasonML to JavaScript |url=https://discuss.ocaml.org/t/ann-melange-1-0-compile-ocaml-reasonml-to-javascript/12305 |access-date=2024-05-24 |website=OCaml |language=en}}</ref> to continue to support compiling OCaml to JavaScript.
== Example ==
<syntaxhighlight lang="reason">
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 ++ "."
};
</syntaxhighlight>
== See also ==
|