Here’s the markdown content translating the provided code to OCaml:
Switch statements express conditionals across many branches.
You can use commas to separate multiple expressions in the same case statement. We use the optional default case in this example as well.
match without an expression is an alternate way to express if/else logic. Here we also show how the case expressions can be non-constants.
A type switch compares types instead of values. You can use this to discover the type of an interface value. In this example, the function whatAmI will analyze the type of its argument.