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

Safe HaskellSafe
LanguageHaskell98

Combinatorics.CardPairs

Contents

Synopsis

general

data Card Source #

Constructors

Other 
Queen 
King 
Instances
Enum Card Source # 
Instance details

Defined in Combinatorics.CardPairs

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 # 
Instance details

Defined in Combinatorics.CardPairs

Methods

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

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

Ord Card Source # 
Instance details

Defined in Combinatorics.CardPairs

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 # 
Instance details

Defined in Combinatorics.CardPairs

Methods

showsPrec :: Int -> Card -> ShowS #

show :: Card -> String #

showList :: [Card] -> ShowS #

data CardCount i Source #

Constructors

CardCount 
Instances
Eq i => Eq (CardCount i) Source # 
Instance details

Defined in Combinatorics.CardPairs

Methods

(==) :: CardCount i -> CardCount i -> Bool #

(/=) :: CardCount i -> CardCount i -> Bool #

Ord i => Ord (CardCount i) Source # 
Instance details

Defined in Combinatorics.CardPairs

Show i => Show (CardCount i) Source # 
Instance details

Defined in Combinatorics.CardPairs

Ix i => Ix (CardCount i) Source # 
Instance details

Defined in Combinatorics.CardPairs

allPossibilities :: CardSet a -> [[a]] 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)

examples

cardSetSizeRummyJK :: CardCount Int Source #

Allow both Jack and King adjacent to Queen.

tests