Maintainer | hapytexeu+gh@gmail.com |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
The 1F0A0 code block can be used to work with cards. This module makes working with the three sets of cards more convenient. The first set are cards with a suit (four suits) and a rank (14 ranks), which allows us to generate 56 cards. Next there are three jokes with the colors red, black and white. Finally there are 21 trump cards and the fool card (a tarot card which normally has no number).
The module contains pattern synonyms that define common aliasses for these cards.
Synopsis
- data CardSuit
- data CardRank
- data JokerColor
- data Trump
- data Card
- back :: Char
- card :: Card -> Char
- card' :: CardSuit -> CardRank -> Char
- joker :: JokerColor -> Char
- trump :: Trump -> Char
- pattern Swords :: CardSuit
- pattern Cups :: CardSuit
- pattern Pentacles :: CardSuit
- pattern Wands :: CardSuit
- pattern Valet :: CardRank
- pattern Bube :: CardRank
- pattern Unter :: CardRank
- pattern Page :: CardRank
- pattern Fante :: CardRank
- pattern Chevalier :: CardRank
- pattern Ober :: CardRank
- pattern Ritter :: CardRank
- pattern Cavall :: CardRank
- pattern Cavaliere :: CardRank
- pattern Dame :: CardRank
- pattern Königin :: CardRank
- pattern Regina :: CardRank
- pattern Roi :: CardRank
- pattern König :: CardRank
- pattern Re :: CardRank
- pattern Childhood :: Trump
- pattern Youth :: Trump
- pattern Maturity :: Trump
- pattern OldAge :: Trump
- pattern Morning :: Trump
- pattern Afternoon :: Trump
- pattern Evening :: Trump
- pattern Night :: Trump
- pattern Earth :: Trump
- pattern Air :: Trump
- pattern Water :: Trump
- pattern Fire :: Trump
- pattern Dance :: Trump
- pattern Shopping :: Trump
- pattern OpenAir :: Trump
- pattern VisualArts :: Trump
- pattern Spring :: Trump
- pattern Summer :: Trump
- pattern Autumn :: Trump
- pattern Winter :: Trump
- pattern Game :: Trump
- pattern Collective :: Trump
- pattern Individual :: Trump
Data structures to define a card
A data type for the card suits
Spades | The spades card suit. |
Hearts | The hearts card suit. |
Diamonds | The diamonds card suit. |
Clubs | The clubs card suit. |
Instances
Bounded CardSuit Source # | |
Enum CardSuit Source # | |
Eq CardSuit Source # | |
Ord CardSuit Source # | |
Defined in Data.Char.Card | |
Read CardSuit Source # | |
Show CardSuit Source # | |
Arbitrary CardSuit Source # | |
A data type for the rank of the card.
Ace | The ace card rank. |
R2 | Card rank 2. |
R3 | Card rank 3. |
R4 | Card rank 4. |
R5 | Card rank 5. |
R6 | Card rank 6. |
R7 | Card rank 7. |
R8 | Card rank 8. |
R9 | Card rank 9. |
R10 | Card rank 10. |
Jack | The jack card rank. |
Knight | The knight card rank. |
Queen | The queen card rank. |
King | The king card rank. |
Instances
Bounded CardRank Source # | |
Enum CardRank Source # | |
Eq CardRank Source # | |
Ord CardRank Source # | |
Defined in Data.Char.Card | |
Read CardRank Source # | |
Show CardRank Source # | |
Arbitrary CardRank Source # | |
data JokerColor Source #
A data type to represent the three colors for which there are jokers: red, black and white.
Instances
A data type for the trump cards, often used for tarot.
Fool | The fool trump card, this tarot card is normally not numbered. |
Trump1 | Tarot card I. |
Trump2 | Tarot card II. |
Trump3 | Tarot card III. |
Trump4 | Tarot card IV. |
Trump5 | Tarot card V. |
Trump6 | Tarot card VI. |
Trump7 | Tarot card VII. |
Trump8 | Tarot card VIII. |
Trump9 | Tarot card IX. |
Trump10 | Tarot card X. |
Trump11 | Tarot card XI. |
Trump12 | Tarot card XII. |
Trump13 | Tarot card XIII. |
Trump14 | Tarot card XIV. |
Trump15 | Tarot card XV. |
Trump16 | Tarot card XVI. |
Trump17 | Tarot card XVII. |
Trump18 | Tarot card XVIII. |
Trump19 | Tarot card XIX. |
Trump20 | Tarot card XX. |
Trump21 | Tarot card XXI. |
A data type that represents the possible types of cards for which there is a Unicode characters. This is the back of a card, a card with a suit and rank, three jokers, and the 21 trump cards and the fool.
Back | The back of the card. |
Card CardSuit CardRank | A card that is a combination of a |
Joker JokerColor | Three possible |
Trump Trump |
Converting cards to the corresponding Unicode character
:: JokerColor | The given |
-> Char | The unicode character that represents the joker with the given color. |
Convert the given JokerColor
to the unicode character which represents
this joker color.
:: Trump | The given 't:Trump' value to convert to a unicode character. |
-> Char | The unicode character that represents the given 't:Trump' playing card. |
Convert the given 't:Trump' value to the unicode equivalent.
Pattern synonyms for cards
Aliasses for the card suits
Aliasses for the card ranks
Aliasses for the jack
pattern Bube :: CardRank Source #
In Germany, Austria and Switzerland, the jack is sometimes called the bube.
pattern Unter :: CardRank Source #
In Germany and Switzerland, the jack is sometimes called the unter.
Aliasses for the knight
Aliasses for the queen
Aliasses for the king
Trump patterns
The four ages
The four times of the day
The four elements
The four leisures
pattern VisualArts :: Trump Source #
The trump card with number XV is named visual arts.
The four seasons
The game
Folly
pattern Collective :: Trump Source #
The trump card with number XXI is named collective.
pattern Individual :: Trump Source #
The trump card with number I is named individual.