I have the follwing function that is suppose to return the value of a card. I'm not sure why the case Num => Num is giving the following error:
Error: Types of rules don't agree, Earlier rules rank->int this rule rank->int->rank
Why would Num=>Num have the return type 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