HCard-0.0: A library for implementing a Deck of Cards

Safe Haskell | None

Data.HCard.Instances

Description

Author : Joe Fredette License : BSD3 Copyright : Joe Fredette

Maintainer : Joe Fredette jfredett.at.gmail.dot.com Stability : Unstable Portability : portable

Synopsis

- data Suit
  - = H
  - | D
  - | C
  - | S
- data Index
  - = Ace
  - | Jack
  - | Queen
  - | King
  - | V Int
- type Classic = CardT Suit Index
- type ClassicDeck = Deck Suit Index
- type ClassicDeckST = DeckST Suit Index
- type ClassicHand = Hand Suit Index
- deal :: Int -> Int -> ClassicDeckST [ClassicHand]

# Documentation

data Suit Source

The Suits of the so-called French deck, the most common American deck of cards.

Constructors

H |
D |
C |
S |

Instances

Bounded Suit |
Enum Suit |
Eq Suit |
Ord Suit |
Read Suit |
Show Suit |
Arbitrary Suit |
Parse Suit |
Card Suit Index |

data Index Source

The Indices of the french deck

Constructors

Ace |
Jack |
Queen |
King |
V Int |

Instances

Bounded Index |
Enum Index |
Eq Index |
Ord Index |
Show Index |
Arbitrary Index |
Parse Index |
Card Suit Index |

type Classic = CardT Suit Index Source

Type synonyms to make using the polymorphic bits easier

type ClassicDeck = Deck Suit Index Source

type ClassicDeckST = DeckST Suit Index Source

type ClassicHand = Hand Suit Index Source

deal :: Int -> Int -> ClassicDeckST [ClassicHand]Source

Wrapper which forces the polymorphic dealHands to work with French-deck cards only.