let card_of_string (s: string) : card option =
let (>>=) o f =
match o with
| Some x -> f x
| None -> None
in
match String.split s ~on:' ' with
| [suit; rank] ->
suit_of_string suit >>= fun suit ->
rank_of_string rank >>= fun rank ->
Some {suit; rank}
| _ -> None