Reporting the highest satisfied poker hand in F#
The solution here is to use an active pattern, which enables you to create a custom matching function.

You can even reuse your existing functions.

It would look like

let |StraightFlush|_| hand = tryStraightFlush hand


then you can use it like this

match hand with
|Straightflush(score) -&gt; ...
| ....