How to use high order functions to filter and match on options fields in a record
So a bit of context is required just to understand my issue. In an RPG, I consider the equipment as a record with optional fields, which means, while they're None that nothing was attributed yet. Equipment is constructed by the game items of the game that represents either weaponry or character protection (helmets and etc) which will be seen in the snippet below. The functionalities are removed and the domain model reduced to make it easier to read. type ConsummableItem = | HealthPotion | ManaPotion type Weaponry = | Sword | Spear | BattleAxe type CharaterProtection = | Helmet | Gloves | Boots