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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DC

Synopsis

Documentation

class DC d where Source #

Minimal complete definition

dC

Methods

dC :: Prism' d () Source #

xC :: d Source #

Instances

parseC :: (DC d, CharParsing p) => p d Source #

>>> parse (parseC <* eof) "test" "C" :: Either ParseError HEXDigit
Right HEXDigitC
>>> parse parseC "test" "Cxyz" :: Either ParseError HEXDigit
Right HEXDigitC
>>> isn't _Right (parse parseC "test" "xyz" :: Either ParseError HEXDigit)
True