Alternative patterns

Alternative patterns can be given for a case clause using the | operator. If any of the patterns match then the clause matches.

case 句には | 演算子を使って別のパターンを指定することができます。いずれかのパターンがマッチすれば、その節はマッチします。

If a pattern defines a variable then all of the alternative patterns for that clause must also define a variable with the same name and same type.

あるパターンが変数を定義している場合、その節のすべての代替パターンも同じ名前で同じ型の変数を定義している必要があります。

Currently it is not possible to have nested alternative patterns, so the pattern [1 | 2 | 3] is not valid.

現在のところ、代替パターンを入れ子にすることはできないので、パターン [1 | 2 | 3] は無効です。