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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DDd

Synopsis

Documentation

type DDd a = (DD a, Dd a) Source #

parseDd :: (DDd d, CharParsing p) => p d Source #

>>> parse (parseDd <* eof) "test" "D" :: Either ParseError (HeXaDeCiMaLDigit' ())
Right (Left ())
>>> parse (parseDd <* eof) "test" "d" :: Either ParseError (HeXaDeCiMaLDigit' ())
Right (Left ())
>>> parse parseDd "test" "Dxyz" :: Either ParseError (HeXaDeCiMaLDigit' ())
Right (Left ())
>>> parse parseDd "test" "dxyz" :: Either ParseError (HeXaDeCiMaLDigit' ())
Right (Left ())
>>> isn't _Right (parse parseDd "test" "xyz" :: Either ParseError (HeXaDeCiMaLDigit' ()))
True
\c -> (c `notElem` "Dd") ==> isn't _Right (parse parseDd "test" [c] :: Either ParseError (HeXaDeCiMaLDigit' ()))