digit-0.5.2: 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 Digit Source # 

Methods

dA :: Prism' Digit () Source #

xA :: Digit Source #

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

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