だからこれは、各曜日のユーザー定義のデータ型の日です(例:等の日曜日、月曜日、)OCamlの構文効率
let is_weekend_day (d:day) : bool =
begin match d with
| Sunday -> true
| Saturday -> true
| _ -> false
end
コードを凝縮する方法はありますか?
ie: Sunday || Saturday -> true
the problem with this is that it's not in syntax, but having 2 additional
lines seems like such a waste of space!
あなたのすべてのバージョンで最初のものはあまり効率的であり、より少ない静的チェックをした後、あなたがそれらを助言するべきではありません。 – Drup