general-games-1.1.1: Library supporting simulation of a number of games

Copyright(c) 2017 Christopher A. Gorski
LicenseMIT
MaintainerChristopher A. Gorski <cgorski@cgorski.org>
Safe HaskellSafe
LanguageHaskell2010

Game.Implement.Card.Standard

Description

The Game.Game.Poker module defines structures and operations for a standard set of 52 playing cards.

Synopsis

Documentation

data PlayingCard #

A representation of a standard playing card, distinguishable by rank and suit.

Constructors

PlayingCard Rank Suit 

Instances

Bounded PlayingCard # 
Enum PlayingCard # 
Eq PlayingCard # 
Ord PlayingCard # 
Read PlayingCard # 
Show PlayingCard # 
Card PlayingCard # 
OrderedCard PlayingCard Order # 
ValuedCard PlayingCard Suit # 
ValuedCard PlayingCard Rank # 
OrderedValuedCard PlayingCard Order ValueType # 

data Rank #

The rank of a standard playing card.

Constructors

Ace 
Two 
Three 
Four 
Five 
Six 
Seven 
Eight 
Nine 
Ten 
Jack 
Queen 
King 

Instances

data Suit #

The suit of a standard playing card.

Constructors

Clubs 
Diamonds 
Hearts 
Spades 

Instances

randomRank :: RandomGen m => Rand m Rank #

Returns a random standard playing card rank, with Ace low.

randomRankR :: RandomGen m => Rank -> Rank -> Rand m Rank #

Returns a random standard playing card from a range, with Ace low.

randomSuit :: RandomGen m => Rand m Suit #

Returns a random Suit.

randomSuitR :: RandomGen m => Suit -> Suit -> Rand m Suit #

Returns a random suit in a given range.

ranks :: [Rank] #

Returns all standard playing card ranks, with Ace low.

nRanks :: Int #

Returns the number of unique standard playing card ranksu.

toRank :: PlayingCard -> Rank #

Returns the Rank of a PlayingCard

toRankLst :: [PlayingCard] -> [Rank] #

Returns a list of Rank of a list of PlayingCard

suits :: [Suit] #

Returns all standard card suits.

nSuits :: Int #

Returns the number of all standard card unique suits.

toSuit :: PlayingCard -> Suit #

Returns the Suit of a PlayingCard

uniqueNumList :: RandomGen g => Int -> Int -> Int -> Rand g (Maybe [Int]) #

Return a list of unique numbers, of length s, drawn without replacement from the set [n..m]

uniqueNumLists :: RandomGen g => [Int] -> Int -> Int -> Rand g (Maybe [[Int]]) #

Return lists of lists of unique numbers, of length [s], drawn without replacement from the set [n..m]