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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D4

Synopsis

Documentation

class D4 d where Source #

Minimal complete definition

d4

Methods

d4 :: Prism' d () Source #

x4 :: d Source #

parse4 :: (D4 d, CharParsing p) => p d Source #

>>> parse (parse4 <* eof) "test" "4" :: Either ParseError DecDigit
Right DecDigit4
>>> parse parse4 "test" "4xyz" :: Either ParseError DecDigit
Right DecDigit4
>>> isn't _Right (parse parse4 "test" "xyz" :: Either ParseError DecDigit)
True