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

Combinatorics.CardPairs

Contents

Synopsis

# general

data Card Source #

Constructors

 Other Queen King

Instances

 Source # Methodssucc :: 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] # Source # Methods(==) :: Card -> Card -> Bool #(/=) :: Card -> Card -> Bool # Source # Methodscompare :: Card -> Card -> Ordering #(<) :: Card -> Card -> Bool #(<=) :: Card -> Card -> Bool #(>) :: Card -> Card -> Bool #(>=) :: Card -> Card -> Bool #max :: Card -> Card -> Card #min :: Card -> Card -> Card # Source # MethodsshowsPrec :: Int -> Card -> ShowS #show :: Card -> String #showList :: [Card] -> ShowS #

data CardCount i Source #

Constructors

 CardCount FieldsotherCount, queenCount, kingCount :: i

Instances

 Eq i => Eq (CardCount i) Source # Methods(==) :: CardCount i -> CardCount i -> Bool #(/=) :: CardCount i -> CardCount i -> Bool # Ord i => Ord (CardCount i) Source # Methodscompare :: CardCount i -> CardCount i -> Ordering #(<) :: CardCount i -> CardCount i -> Bool #(<=) :: CardCount i -> CardCount i -> Bool #(>) :: CardCount i -> CardCount i -> Bool #(>=) :: CardCount i -> CardCount i -> Bool #max :: CardCount i -> CardCount i -> CardCount i #min :: CardCount i -> CardCount i -> CardCount i # Show i => Show (CardCount i) Source # MethodsshowsPrec :: Int -> CardCount i -> ShowS #show :: CardCount i -> String #showList :: [CardCount i] -> ShowS # Ix i => Ix (CardCount i) Source # Methodsrange :: (CardCount i, CardCount i) -> [CardCount i] #index :: (CardCount i, CardCount i) -> CardCount i -> Int #unsafeIndex :: (CardCount i, CardCount i) -> CardCount i -> IntinRange :: (CardCount i, CardCount i) -> CardCount i -> Bool #rangeSize :: (CardCount i, CardCount i) -> Int #unsafeRangeSize :: (CardCount i, CardCount i) -> Int

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

Allow both Jack and King adjacent to Queen.