Reputation: 11595
I referenced this link. However, I still don't see how I can OR the following union cases:
match count with
| x when x < 2 -> grid |> setCell { X=x; Y=y; State=Dead }
| x when x > 3 -> grid |> setCell { X=x; Y=y; State=Dead }
| _ -> grid
I want to do this:
match count with
| x when x < 2
| x when x > 3 -> grid |> setCell { X=x; Y=y; State=Dead }
| _ -> grid
Is this possible?
Upvotes: 1
Views: 87
Reputation: 1159
With a boolean OR operator ||
match count with
| x when x > 3 || x < 2 -> grid |> setCell { X=x; Y=y; State=Dead }
| _ -> grid
Upvotes: 4
Reputation: 233125
How about inverting the matches?
match count with
| 1
| 2 -> grid
| _ -> grid |> setCell { X=count; Y=y; State=Dead }
Upvotes: 3