Tryiing to create a way to count points for a whist game.
## Deliverables
i need a function that will filter a suit from an arranged hand then convert each item of that suit to its point value then sum them together(map). This should be done for all suits. In the end i should be given the total value of the hand
here are my datatypes:
data Suit = Club | Diamond | Heart | Spade
deriving (Read, Show, Enum, Eq, Ord)
data CardValue = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King | Ace
deriving (Read, Show, Enum, Eq, Ord)
data CardDescription = CardDescription {suit::Suit, value::Pips}
deriving (Read, Show, Enum, Eq, Ord)
type Hand = [CardDescription]
points are as follows Jack 5 Queen 4 King 3 Ace 2 Ten 1
so if i am given a hand containing club two, club ace, heart jack, diamond ace, spade king, spade king
my return value should be club 2
diamond 2
heart 5
spade 6
total value 15