title: F#: Accessing values of decision Union
body: <p>Is there a better way or an alternative for the <code>getHandRankValue</code> function?
  Maybe without the match</p>
  <pre><code>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 -&gt; x
      | FourOfAKind x -&gt; x
      | FullHouse x -&gt; x
      | Flush x -&gt; x
      | Straight x -&gt; x
      | ThreeOfAKind x -&gt; x
      | TwoPair x -&gt; x
      | OnePair x -&gt; x
      | HighCard x -&gt; x
  
  let ranks = [Flush([8;6;4;3;2]); TwoPair([8;4;7]); Straight([8])]
  
  let rankValues = ranks |&gt; List.map getHandRankValue
  </code></pre>
  <p>result is <code>[[8;6;4;3;2]; [8;4;7]; [8]]</code></p>