combinatorial-0.0: Count, enumerate, rank and unrank combinatorial objects

Safe HaskellSafe
LanguageHaskell98

Combinatorics.CardPairs

Synopsis

Documentation

type CardSet a = [(a, Int)] Source #

data Card Source #

Constructors

Other 
Queen 
King 

Instances

Enum Card Source # 

Methods

succ :: Card -> Card #

pred :: Card -> Card #

toEnum :: Int -> Card #

fromEnum :: Card -> Int #

enumFrom :: Card -> [Card] #

enumFromThen :: Card -> Card -> [Card] #

enumFromTo :: Card -> Card -> [Card] #

enumFromThenTo :: Card -> Card -> Card -> [Card] #

Eq Card Source # 

Methods

(==) :: Card -> Card -> Bool #

(/=) :: Card -> Card -> Bool #

Ord Card Source # 

Methods

compare :: Card -> Card -> Ordering #

(<) :: Card -> Card -> Bool #

(<=) :: Card -> Card -> Bool #

(>) :: Card -> Card -> Bool #

(>=) :: Card -> Card -> Bool #

max :: Card -> Card -> Card #

min :: Card -> Card -> Card #

Show Card Source # 

Methods

showsPrec :: Int -> Card -> ShowS #

show :: Card -> String #

showList :: [Card] -> ShowS #

sample :: (a -> b) -> [a] -> [(a, b)] Source #

Candidate for utility-ht:

data CardCount i Source #

Constructors

CardCount 

Instances

sumCard :: Num i => CardCount i -> i Source #

possibilitiesCardsBorderNaive :: CardCount Int -> CardCount Integer Source #

Count the number of card set orderings with adjacent queen and king. We return a triple where the elements count with respect to an additional condition: (card set starts with an ordinary card ' ', start with queen q, start with king k)

cardSetSizeRummyJK :: CardCount Int Source #

Allow both Jack and King adjacent to Queen.