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.Dice

Contents

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
Bounded DieValue Source # 
Instance details

Defined in Data.Char.Dice

Enum DieValue Source # 
Instance details

Defined in Data.Char.Dice

Eq DieValue Source # 
Instance details

Defined in Data.Char.Dice

Ord DieValue Source # 
Instance details

Defined in Data.Char.Dice

Read DieValue Source # 
Instance details

Defined in Data.Char.Dice

Show DieValue Source # 
Instance details

Defined in Data.Char.Dice

Arbitrary DieValue Source # 
Instance details

Defined in Data.Char.Dice

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.