digit-0.8: A data-type representing digits 0-9 and other combinations

Safe HaskellNone
LanguageHaskell2010

Data.Digit.Char

Contents

Synopsis

Binary

charBinaryNoZero :: BinaryNoZero d => Prism' Char d Source #

>>> '1' ^? charBinaryNoZero :: Maybe BinDigit
Just BinDigit1
>>> charBinaryNoZero # BinDigit1
'1'

charBinary :: Binary d => Prism' Char d Source #

>>> '0' ^? charBinary :: Maybe BinDigit
Just BinDigit0
>>> charBinary # BinDigit0 :: Char
'0'

Octal

charOctalNoZero :: OctalNoZero d => Prism' Char d Source #

>>> '6' ^? charOctalNoZero :: Maybe OctDigit
Just OctDigit6
>>> charOctalNoZero # OctDigit5 :: Char
'5'

charOctal :: Octal d => Prism' Char d Source #

>>> '7' ^? charOctal :: Maybe OctDigit
Just OctDigit7
>>> charOctal # OctDigit7 :: Char
'7'

Decimal

charDecimalNoZero :: DecimalNoZero d => Prism' Char d Source #

>>> '9' ^? charDecimalNoZero :: Maybe DecDigit
Just DecDigit9
>>> charDecimalNoZero # DecDigit9 :: Char
'9'

charDecimal :: Decimal d => Prism' Char d Source #

>>> '9' ^? charDecimal :: Maybe DecDigit
Just DecDigit9
>>> charDecimal # DecDigit9 :: Char
'9'

Hexadecimal

charHexadecimalNoZero :: HexadecimalNoZero d => Prism' Char d Source #

>>> 'f' ^? charHexadecimalNoZero :: Maybe HexDigit
Just HexDigitf
>>> charHexadecimalNoZero # HexDigitf :: Char
'f'

charHexadecimal :: Hexadecimal d => Prism' Char d Source #

>>> 'f' ^? charHexadecimal :: Maybe HexDigit
Just HexDigitf
>>> charHexadecimal # HexDigitf :: Char
'f'

HEXADECIMAL

charHEXADECIMALNoZero :: HEXADECIMALNoZero d => Prism' Char d Source #

>>> 'F' ^? charHEXADECIMALNoZero :: Maybe HEXDigit
Just HEXDigitF
>>> charHEXADECIMALNoZero # HEXDigitF :: Char
'F'

charHEXADECIMAL :: HEXADECIMAL d => Prism' Char d Source #

>>> 'F' ^? charHEXADECIMAL :: Maybe HEXDigit
Just HEXDigitF
>>> charHEXADECIMAL # HEXDigitF :: Char
'F'

HeXaDeCiMaL

charHeXaDeCiMaLNoZero :: HeXaDeCiMaLNoZero d => Prism' Char d Source #

>>> 'f' ^? charHeXaDeCiMaLNoZero :: Maybe HeXDigit
Just HeXDigitf
>>> 'F' ^? charHeXaDeCiMaLNoZero :: Maybe HeXDigit
Just HeXDigitF
>>> charHeXaDeCiMaLNoZero # HeXDigitf :: Char
'f'
>>> charHeXaDeCiMaLNoZero # HeXDigitF :: Char
'F'

charHeXaDeCiMaL :: HeXaDeCiMaL d => Prism' Char d Source #

>>> 'f' ^? charHeXaDeCiMaL :: Maybe HeXDigit
Just HeXDigitf
>>> 'F' ^? charHeXaDeCiMaL :: Maybe HeXDigit
Just HeXDigitF
>>> charHeXaDeCiMaL # HeXDigitf :: Char
'f'
>>> charHeXaDeCiMaL # HeXDigitF :: Char
'F'