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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D9

Synopsis

Documentation

class D9 d where Source #

Minimal complete definition

d9

Methods

d9 :: Prism' d () Source #

x9 :: d Source #

parse9 :: (D9 d, CharParsing p) => p d Source #

>>> parse (parse9 <* eof) "test" "9" :: Either ParseError DecDigit
Right DecDigit9
>>> parse parse9 "test" "9xyz" :: Either ParseError DecDigit
Right DecDigit9
>>> isn't _Right (parse parse9 "test" "xyz" :: Either ParseError DecDigit)
True