unicode-tricks-0.14.1.0: Functions to work with unicode blocks more convenient.
Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Data.Char.Dice

Description

Unicode has a block named Miscellaneous Symbols that includes unicode characters for dice, this module aims to make it more convenient to render die characters.

Synopsis

Represent die values

data DieValue Source #

A data type to store the values of a die.

Constructors

I

A die with value one, represented with ⚀.

II

A die with value two, represented with ⚁.

III

A die with value three, represented with ⚂.

IV

A die with value four, represented with ⚃.

V

A die with value five, represented with ⚄.

VI

A die with value six, represented with ⚅.

Instances

Instances details
Arbitrary DieValue Source # 
Instance details

Defined in Data.Char.Dice

Data DieValue Source # 
Instance details

Defined in Data.Char.Dice

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DieValue -> c DieValue #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DieValue #

toConstr :: DieValue -> Constr #

dataTypeOf :: DieValue -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DieValue) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DieValue) #

gmapT :: (forall b. Data b => b -> b) -> DieValue -> DieValue #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DieValue -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DieValue -> r #

gmapQ :: (forall d. Data d => d -> u) -> DieValue -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DieValue -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DieValue -> m DieValue #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DieValue -> m DieValue #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DieValue -> m DieValue #

Bounded DieValue Source # 
Instance details

Defined in Data.Char.Dice

Enum DieValue Source # 
Instance details

Defined in Data.Char.Dice

Generic DieValue Source # 
Instance details

Defined in Data.Char.Dice

Associated Types

type Rep DieValue :: Type -> Type #

Methods

from :: DieValue -> Rep DieValue x #

to :: Rep DieValue x -> DieValue #

Read DieValue Source # 
Instance details

Defined in Data.Char.Dice

Show DieValue Source # 
Instance details

Defined in Data.Char.Dice

NFData DieValue Source # 
Instance details

Defined in Data.Char.Dice

Methods

rnf :: DieValue -> () #

Eq DieValue Source # 
Instance details

Defined in Data.Char.Dice

Ord DieValue Source # 
Instance details

Defined in Data.Char.Dice

Hashable DieValue Source # 
Instance details

Defined in Data.Char.Dice

Methods

hashWithSalt :: Int -> DieValue -> Int #

hash :: DieValue -> Int #

UnicodeCharacter DieValue Source # 
Instance details

Defined in Data.Char.Dice

UnicodeText DieValue Source # 
Instance details

Defined in Data.Char.Dice

UnicodeCharacter (Oriented (Domino DieValue)) Source # 
Instance details

Defined in Data.Char.Domino

UnicodeCharacter (Oriented (Domino (Maybe DieValue))) Source # 
Instance details

Defined in Data.Char.Domino

UnicodeText (Oriented (Domino DieValue)) Source # 
Instance details

Defined in Data.Char.Domino

UnicodeText (Oriented (Domino (Maybe DieValue))) Source # 
Instance details

Defined in Data.Char.Domino

type Rep DieValue Source # 
Instance details

Defined in Data.Char.Dice

type Rep DieValue = D1 ('MetaData "DieValue" "Data.Char.Dice" "unicode-tricks-0.14.1.0-EInLeozqGjBL3vIQTNPsAm" 'False) ((C1 ('MetaCons "I" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "II" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "III" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "IV" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "V" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "VI" 'PrefixI 'False) (U1 :: Type -> Type))))

Convert to a die value

toDieValue Source #

Arguments

:: Integral i 
=> i

The given integral value to convert to a DieValue.

-> Maybe DieValue

A DieValue wrapped in a Just if the given integral value is greater than zero, and less than seven, otherwise Nothing.

Convert the given integral value to a DieValue that represents the given number. If the number is less than one, or greater than six, Nothing is returned.

Render a die

die Source #

Arguments

:: DieValue

The die value to convert.

-> Char

A unicode character that represents a die with the given DieValue.

Convert the given DieValue to a unicode character that represents a die with that value.