Is there a better way or an alternative for the getHandRankValue function?
Maybe without the match
type HandRank =
| StraightFlush of int list
| FourOfAKind of int list
| FullHouse of int list
| Flush of int list
| Straight of int list
| ThreeOfAKind of int list
| TwoPair of int list
| OnePair of int list
| HighCard of int list
let getHandRankValue handRank =
match handRank with
| StraightFlush x -> x
| FourOfAKind x -> x
| FullHouse x -> x
| Flush x -> x
| Straight x -> x
| ThreeOfAKind x -> x
| TwoPair x -> x
| OnePair x -> x
| HighCard x -> x
let ranks = [Flush([8;6;4;3;2]); TwoPair([8;4;7]); Straight([8])]
let rankValues = ranks |> List.map getHandRankValue
result is [[8;6;4;3;2]; [8;4;7]; [8]]