我有以下函数,假设返回卡片的值。我不确定为什么案例 Num => Num 会出现以下错误:
错误:规则类型不一致,较早的规则rank->int 此规则rank->int->rank
为什么 Num=>Num 会有返回类型 rank->int->rank
datatype suit = Clubs | Diamonds | Hearts | Spades
datatype rank = Jack | Queen | King | Ace | Num of int
type card = suit * rank
fun card_value (suit, rank)=
case rank of
Ace =>11
| Jack =>10
| King =>10
| Queen =>10
| Num => Num ;
card_value(Clubs,Ace); //calling function