谁能解释为什么下面的 2 个 let 语句不起作用?
type Rank =
| Two
| Three
| Four
| Five
| Six
| Seven
| Eight
| Nine
| Ten
type Face =
| Jack
| Queen
| King
| Ace
type Suit =
| Diamonds
| Clubs
| Hearts
| Spades
type Card =
| RankCard of Rank * Suit
| FaceCard of Face * Suit
let deck : Card = [ (Two, Diamonds); (Jack, Hearts) ]
此表达式应为 Card 类型,但此处的类型为 'a list
这让
let deck : Card list = [ (Two, Diamonds); (Jack, Hearts) ]
表达式应该有类型 Card 但这里有类型 'a * 'b