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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DBb

Synopsis

Documentation

type DBb a = (DB a, Db a) Source #

parseBb :: (DBb d, CharParsing p) => p d Source #

>>> parse (parseBb <* eof) "test" "B" :: Either ParseError Digit
Right B
>>> parse parseBb "test" "Bxyz" :: Either ParseError Digit
Right B
>>> parse (parseBb <* eof) "test" "b" :: Either ParseError Digit
Right b
>>> parse parseBb "test" "bxyz" :: Either ParseError Digit
Right b
>>> isn't _Right (parse parseBb "test" "xyz" :: Either ParseError Digit)
True
\c -> (c `notElem` "Bb") ==> isn't _Right (parse parseBb "test" [c] :: Either ParseError Digit)