I've got a list of things and I want to filter based on a Union type. simplified, it might be something like this:
type Groceries =
Apples
| Cheese
| Widgets
shoppingList = [Apples, Cheese, Cheese, Widgets, Apples]
is there a nice syntax for filtering all the elements that match a particular subtype?
# idk, eg
fruit = shoppingList |> List.filter =Apple?
I know i can use a lambda with a case statement but it seems so verbose!