[resolvido] Duvida sobre pattern matching

Olá,

Lendo o capitulo 3 do livro “Ocaml programação funcional na prática”, eu fiquei com duvida em relação ao warning do compilador. O código é:

(* rock paper scissors lizard spock *)
(*
  Scissors cuts Paper
  Paper covers Rock
  Rock crushes Lizard
  Lizard poisons Spock
  Spock smashes Scissors
  Scissors decapitates Lizard
  Lizard eats Paper
  Paper disproves Spock
  Spock vaporizes Rock
  (and as it always has) Rock crushes Scissors
*)

type variables = Rock | Paper | Scissors | Lizard | Spock;;
type game = {player1 : variables; player2 : variables};;
let game_play (g : game) =
  match g with
    {player1 = Rock; player2 = Paper} -> Rock
    | {player1 = Rock; player2 = Scissors} -> Rock
    | {player1 = Rock; player2 = Lizard} -> Rock
    | {player1 = Rock; player2 = Spock} -> Spock
    | {player1 = Paper; player2 = Scissors} -> Scissors
    | {player1 = Paper; player2 = Lizard} -> Lizard
    | {player1 = Paper; player2 = Spock} -> Paper
    | {player1 = Scissors; player2 = Lizard} -> Scissors
    | {player1 = Scissors; player2 = Spock} -> Spock
    | {player1 = Lizard; player2 = Spock} -> Lizard;;

O warning que eu recebi foi:

Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
{player1=Spock}

Mas até onde eu entendi [e testei] não seria possível criar um registro(?) com apenas o player 1:

utop[17]> let x = {player1=Spock};;
Error: Some record fields are undefined: player2

Alguma ideia?

[ ]'s

Problema resolvido. De fato não é um erro, eu apenas não considerei player1 = Spock. (sim, erro juvenil =[ )

(* rock paper scissors lizard spock *)
(*
  Scissors cuts Paper
  Paper covers Rock
  Rock crushes Lizard
  Lizard poisons Spock
  Spock smashes Scissors
  Scissors decapitates Lizard
  Lizard eats Paper
  Paper disproves Spock
  Spock vaporizes Rock
  (and as it always has) Rock crushes Scissors
*)

type variables = Rock | Paper | Scissors | Lizard | Spock;;

let game_play player1 player2 =
  match  player1, player2 with
    Rock, Lizard -> Rock
    | Rock, Scissors -> Rock
    | Rock, _ -> player2
    | Paper, Rock -> Paper
    | Paper, Spock -> Paper
    | Paper, _ -> player2
    | Scissors, Paper -> Scissors
    | Scissors, Lizard -> Scissors
    | Scissors, _ -> player2
    | Lizard, Spock -> Lizard
    | Lizard, Paper -> Lizard
    | Lizard, _ -> player2
    | Spock, Rock -> Spock
    | Spock, Scissors -> Spock
    | Spock, Lizard -> Spock
    | Spock, _ -> player2;;

game_play  Spock Rock;;