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
Arbitrary CardSuit Source # | |
Data CardSuit Source # | |
Defined in Data.Char.Card gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CardSuit -> c CardSuit # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CardSuit # toConstr :: CardSuit -> Constr # dataTypeOf :: CardSuit -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CardSuit) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CardSuit) # gmapT :: (forall b. Data b => b -> b) -> CardSuit -> CardSuit # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CardSuit -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CardSuit -> r # gmapQ :: (forall d. Data d => d -> u) -> CardSuit -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CardSuit -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CardSuit -> m CardSuit # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CardSuit -> m CardSuit # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CardSuit -> m CardSuit # | |
Bounded CardSuit Source # | |
Enum CardSuit Source # | |
Generic CardSuit Source # | |
Read CardSuit Source # | |
Show CardSuit Source # | |
NFData CardSuit Source # | |
Defined in Data.Char.Card | |
Eq CardSuit Source # | |
Ord CardSuit Source # | |
Defined in Data.Char.Card | |
Hashable CardSuit Source # | |
Defined in Data.Char.Card | |
UnicodeCharacter CardSuit Source # | |
Defined in Data.Char.Card | |
UnicodeText CardSuit Source # | |
Defined in Data.Char.Card | |
type Rep CardSuit Source # | |
Defined in Data.Char.Card type Rep CardSuit = D1 ('MetaData "CardSuit" "Data.Char.Card" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) ((C1 ('MetaCons "Spades" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Hearts" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Diamonds" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Clubs" 'PrefixI 'False) (U1 :: Type -> Type))) |
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
Arbitrary CardRank Source # | |
Data CardRank Source # | |
Defined in Data.Char.Card gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CardRank -> c CardRank # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CardRank # toConstr :: CardRank -> Constr # dataTypeOf :: CardRank -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CardRank) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CardRank) # gmapT :: (forall b. Data b => b -> b) -> CardRank -> CardRank # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CardRank -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CardRank -> r # gmapQ :: (forall d. Data d => d -> u) -> CardRank -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CardRank -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CardRank -> m CardRank # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CardRank -> m CardRank # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CardRank -> m CardRank # | |
Bounded CardRank Source # | |
Enum CardRank Source # | |
Generic CardRank Source # | |
Read CardRank Source # | |
Show CardRank Source # | |
NFData CardRank Source # | |
Defined in Data.Char.Card | |
Eq CardRank Source # | |
Ord CardRank Source # | |
Defined in Data.Char.Card | |
Hashable CardRank Source # | |
Defined in Data.Char.Card | |
type Rep CardRank Source # | |
Defined in Data.Char.Card type Rep CardRank = D1 ('MetaData "CardRank" "Data.Char.Card" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) (((C1 ('MetaCons "Ace" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "R2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R3" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "R4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R5" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "R6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R7" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "R8" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "R9" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R10" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Jack" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Knight" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Queen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "King" 'PrefixI 'False) (U1 :: Type -> Type))))) |
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. |
Instances
Arbitrary Trump Source # | |
Data Trump Source # | |
Defined in Data.Char.Card gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Trump -> c Trump # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Trump # dataTypeOf :: Trump -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Trump) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Trump) # gmapT :: (forall b. Data b => b -> b) -> Trump -> Trump # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Trump -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Trump -> r # gmapQ :: (forall d. Data d => d -> u) -> Trump -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Trump -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Trump -> m Trump # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Trump -> m Trump # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Trump -> m Trump # | |
Bounded Trump Source # | |
Enum Trump Source # | |
Generic Trump Source # | |
Read Trump Source # | |
Show Trump Source # | |
NFData Trump Source # | |
Defined in Data.Char.Card | |
Eq Trump Source # | |
Ord Trump Source # | |
Hashable Trump Source # | |
Defined in Data.Char.Card | |
type Rep Trump Source # | |
Defined in Data.Char.Card type Rep Trump = D1 ('MetaData "Trump" "Data.Char.Card" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) ((((C1 ('MetaCons "Fool" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Trump2" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Trump3" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump4" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Trump5" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Trump6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump7" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Trump8" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Trump9" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump10" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "Trump11" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump12" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Trump13" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Trump14" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump15" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Trump16" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Trump17" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump18" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Trump19" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Trump20" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trump21" 'PrefixI 'False) (U1 :: Type -> Type)))))) |
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 |
Instances
Arbitrary Card Source # | |
Data Card Source # | |
Defined in Data.Char.Card gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Card -> c Card # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Card # dataTypeOf :: Card -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Card) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Card) # gmapT :: (forall b. Data b => b -> b) -> Card -> Card # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Card -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Card -> r # gmapQ :: (forall d. Data d => d -> u) -> Card -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Card -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Card -> m Card # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Card -> m Card # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Card -> m Card # | |
Bounded Card Source # | |
Generic Card Source # | |
Read Card Source # | |
Show Card Source # | |
NFData Card Source # | |
Defined in Data.Char.Card | |
Eq Card Source # | |
Ord Card Source # | |
Hashable Card Source # | |
Defined in Data.Char.Card | |
type Rep Card Source # | |
Defined in Data.Char.Card type Rep Card = D1 ('MetaData "Card" "Data.Char.Card" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) ((C1 ('MetaCons "Back" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Card" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CardSuit) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CardRank))) :+: (C1 ('MetaCons "Joker" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JokerColor)) :+: C1 ('MetaCons "Trump" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 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.