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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DCc

Synopsis

Documentation

type DCc a = (DC a, Dc a) Source #

parseCc :: (DCc d, CharParsing p) => p d Source #

>>> parse (parseCc <* eof) "test" "C" :: Either ParseError HeXDigit
Right HeXDigitC
>>> parse parseCc "test" "Cxyz" :: Either ParseError HeXDigit
Right HeXDigitC
>>> parse (parseCc <* eof) "test" "c" :: Either ParseError HeXDigit
Right HeXDigitc
>>> parse parseCc "test" "cxyz" :: Either ParseError HeXDigit
Right HeXDigitc
>>> isn't _Right (parse parseCc "test" "xyz" :: Either ParseError HeXDigit)
True