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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DAa

Synopsis

Documentation

type DAa a = (DA a, Da a) Source #

parseAa :: (DAa d, CharParsing p) => p d Source #

>>> parse (parseAa <* eof) "test" "A" :: Either ParseError Digit
Right A
>>> parse parseAa "test" "Axyz" :: Either ParseError Digit
Right A
>>> parse (parseAa <* eof) "test" "a" :: Either ParseError Digit
Right a
>>> parse parseAa "test" "axyz" :: Either ParseError Digit
Right a
>>> isn't _Right (parse parseAa "test" "xyz" :: Either ParseError Digit)
True
\c -> (c `notElem` "Aa") ==> isn't _Right (parse parseAa "test" [c] :: Either ParseError Digit)