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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DA

Synopsis

Documentation

class DA d where Source #

Minimal complete definition

dA

Methods

dA :: Prism' d () Source #

xA :: d Source #

Instances

DA () Source # 

Methods

dA :: Prism' () () Source #

xA :: () Source #

DA a => DA (DigitA a) Source # 

Methods

dA :: Prism' (DigitA a) () Source #

xA :: DigitA a Source #

DA d => DA (Either d x) Source # 

Methods

dA :: Prism' (Either d x) () Source #

xA :: Either d x Source #

parseA :: (DA d, CharParsing p) => p d Source #

>>> parse (parseA <* eof) "test" "A" :: Either ParseError (DigitA ())
Right (DigitA ())
>>> parse parseA "test" "Axyz" :: Either ParseError (DigitA ())
Right (DigitA ())
>>> isn't _Right (parse parseA "test" "xyz" :: Either ParseError (DigitA ()))
True
\c -> c /= 'A' ==> isn't _Right (parse parseA "test" [c] :: Either ParseError (DigitA ()))