import Char -- take this line out if you are using the 2002 version of Hugs data Suit = Clubs | Diamonds | Hearts | Spades deriving (Eq, Ord, Enum, Show) data Card = Carte Suit Int deriving (Eq,Show) -- -- Add Card as an instance of the Show type class -- instance Show Card where -- show (Carte s n) -- | (n==1) = 'A':abbrev -- | (n==11) = 'J':abbrev -- | (n==12) = 'Q':abbrev -- | (n==13) = 'K':abbrev -- | otherwise = (show n) ++ abbrev -- where abbrev = '~':take 1 (show s) type Pack = [Card] hand1, hand2, fulldeck :: Pack hand1 = [Carte Spades 1, Carte Hearts 3, Carte Clubs 11, Carte Clubs 10, Carte Diamonds 1] hand2 = [Carte Diamonds 13, Carte Clubs 13, Carte Hearts 13, Carte Clubs 7, Carte Spades 1] fulldeck = [Carte s n | s <- [Clubs .. Spades], n <-[1..13]] type State = (Pack,Pack,Pack)