unicode-tricks-0.6.0.0: Functions to work with unicode blocks more convenient.

Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Data.Char.Card

Contents

Description

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 structures to define a card

data CardSuit Source #

A data type for the card suits

Constructors

Spades

The spades card suit.

Hearts

The hearts card suit.

Diamonds

The diamonds card suit.

Clubs

The clubs card suit.

Instances
Bounded CardSuit Source # 
Instance details

Defined in Data.Char.Card

Enum CardSuit Source # 
Instance details

Defined in Data.Char.Card

Eq CardSuit Source # 
Instance details

Defined in Data.Char.Card

Ord CardSuit Source # 
Instance details

Defined in Data.Char.Card

Read CardSuit Source # 
Instance details

Defined in Data.Char.Card

Show CardSuit Source # 
Instance details

Defined in Data.Char.Card

Arbitrary CardSuit Source # 
Instance details

Defined in Data.Char.Card

data CardRank Source #

A data type for the rank of the card.

Constructors

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

Defined in Data.Char.Card

Enum CardRank Source # 
Instance details

Defined in Data.Char.Card

Eq CardRank Source # 
Instance details

Defined in Data.Char.Card

Ord CardRank Source # 
Instance details

Defined in Data.Char.Card

Read CardRank Source # 
Instance details

Defined in Data.Char.Card

Show CardRank Source # 
Instance details

Defined in Data.Char.Card

Arbitrary CardRank Source # 
Instance details

Defined in Data.Char.Card

data JokerColor Source #

A data type to represent the three colors for which there are jokers: red, black and white.

Constructors

Red

The red joker.

Black

The black joker.

White

The white joker.

Instances
Bounded JokerColor Source # 
Instance details

Defined in Data.Char.Card

Enum JokerColor Source # 
Instance details

Defined in Data.Char.Card

Eq JokerColor Source # 
Instance details

Defined in Data.Char.Card

Ord JokerColor Source # 
Instance details

Defined in Data.Char.Card

Read JokerColor Source # 
Instance details

Defined in Data.Char.Card

Show JokerColor Source # 
Instance details

Defined in Data.Char.Card

Arbitrary JokerColor Source # 
Instance details

Defined in Data.Char.Card

data Trump Source #

A data type for the trump cards, often used for tarot.

Constructors

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.

Instances
Bounded Trump Source # 
Instance details

Defined in Data.Char.Card

Enum Trump Source # 
Instance details

Defined in Data.Char.Card

Eq Trump Source # 
Instance details

Defined in Data.Char.Card

Methods

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

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

Ord Trump Source # 
Instance details

Defined in Data.Char.Card

Methods

compare :: Trump -> Trump -> Ordering #

(<) :: Trump -> Trump -> Bool #

(<=) :: Trump -> Trump -> Bool #

(>) :: Trump -> Trump -> Bool #

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

max :: Trump -> Trump -> Trump #

min :: Trump -> Trump -> Trump #

Read Trump Source # 
Instance details

Defined in Data.Char.Card

Show Trump Source # 
Instance details

Defined in Data.Char.Card

Methods

showsPrec :: Int -> Trump -> ShowS #

show :: Trump -> String #

showList :: [Trump] -> ShowS #

Arbitrary Trump Source # 
Instance details

Defined in Data.Char.Card

Methods

arbitrary :: Gen Trump #

shrink :: Trump -> [Trump] #

data Card Source #

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.

Constructors

Back

The back of the card.

Card CardSuit CardRank

A card that is a combination of a CardSuit and a CardRank. There are 56 possibilities.

Joker JokerColor

Three possible JokerColor cards.

Trump Trump 
Instances
Eq Card Source # 
Instance details

Defined in Data.Char.Card

Methods

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

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

Ord Card Source # 
Instance details

Defined in Data.Char.Card

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 #

Read Card Source # 
Instance details

Defined in Data.Char.Card

Show Card Source # 
Instance details

Defined in Data.Char.Card

Methods

showsPrec :: Int -> Card -> ShowS #

show :: Card -> String #

showList :: [Card] -> ShowS #

Arbitrary Card Source # 
Instance details

Defined in Data.Char.Card

Methods

arbitrary :: Gen Card #

shrink :: Card -> [Card] #

Converting cards to the corresponding Unicode character

back :: Char Source #

The unicode character that represents the back of the card.

card :: Card -> Char Source #

Convert the given Card object to its unicode equivalent.

card' Source #

Arguments

:: CardSuit

The given CardSuit for the card.

-> CardRank

The given CardRank for the card.

-> Char

The corresponding unicode character with the given suit and rank.

Convert the given CardSuit and CardRank to the equivalent unicode character for this card.

joker Source #

Arguments

:: JokerColor

The given JokerColor to convert to a unicode character.

-> 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 Source #

Arguments

:: 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

pattern Swords :: CardSuit Source #

Swords is an alias for the spades card suit.

pattern Cups :: CardSuit Source #

Cups is an alias for the hearts card suit.

pattern Pentacles :: CardSuit Source #

Pentacles is an alias for the diamonds card suit.

pattern Wands :: CardSuit Source #

Wands is an alias for the clubs card suit.

Aliasses for the card ranks

Aliasses for the jack

pattern Valet :: CardRank Source #

In France, the jack is sometimes called the valet.

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.

pattern Page :: CardRank Source #

An alternative name for the jack is page.

pattern Fante :: CardRank Source #

In Italy, the jack is sometimes called the fante.

Aliasses for the knight

pattern Chevalier :: CardRank Source #

In France, the knight is sometimes called the chevalier.

pattern Ober :: CardRank Source #

In Germany, the knight is sometimes called the ober.

pattern Ritter :: CardRank Source #

In Germany, the knight is sometimes called the ritter.

pattern Cavall :: CardRank Source #

An alternative name for the jack is cavall.

pattern Cavaliere :: CardRank Source #

An alternative name for the jack is cavaliere.

Aliasses for the queen

pattern Dame :: CardRank Source #

An alternative name for the queen is dame.

pattern Königin :: CardRank Source #

In Germany, the queen is sometimes called the königin.

pattern Regina :: CardRank Source #

In Italy, the queen is sometimes called the regina.

Aliasses for the king

pattern Roi :: CardRank Source #

In France, the king is sometimes called the roi.

pattern König :: CardRank Source #

In Germany, the king is sometimes called the könig.

pattern Re :: CardRank Source #

In Italy, the queen is sometimes called the re.

Trump patterns

The four ages

pattern Childhood :: Trump Source #

The trump card with number II is named childhood.

pattern Youth :: Trump Source #

The trump card with number III is named youth.

pattern Maturity :: Trump Source #

The trump card with number IV is named maturity.

pattern OldAge :: Trump Source #

The trump card with number V is named old age.

The four times of the day

pattern Morning :: Trump Source #

The trump card with number VI is named morning.

pattern Afternoon :: Trump Source #

The trump card with number VII is named afternoon.

pattern Evening :: Trump Source #

The trump card with number VIII is named evening.

pattern Night :: Trump Source #

The trump card with number IX is named night.

The four elements

pattern Earth :: Trump Source #

The trump card with number X is named earth.

pattern Air :: Trump Source #

The trump card with number X is named air.

pattern Water :: Trump Source #

The trump card with number XI is named water.

pattern Fire :: Trump Source #

The trump card with number XI is named fire.

The four leisures

pattern Dance :: Trump Source #

The trump card with number XII is named dance.

pattern Shopping :: Trump Source #

The trump card with number XIII is named shopping.

pattern OpenAir :: Trump Source #

The trump card with number XIV is named open air.

pattern VisualArts :: Trump Source #

The trump card with number XV is named visual arts.

The four seasons

pattern Spring :: Trump Source #

The trump card with number XVI is named spring.

pattern Summer :: Trump Source #

The trump card with number XVII is named summer.

pattern Autumn :: Trump Source #

The trump card with number XVIII is named autumn.

pattern Winter :: Trump Source #

The trump card with number XIX is named winter.

The game

pattern Game :: Trump Source #

The trump card with number XX is named 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.