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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DC

Synopsis

Documentation

class DC d where Source #

Minimal complete definition

dC

Methods

dC :: Prism' d () Source #

xC :: d Source #

Instances

DC () Source # 

Methods

dC :: Prism' () () Source #

xC :: () Source #

DC a => DC (DigitC a) Source # 

Methods

dC :: Prism' (DigitC a) () Source #

xC :: DigitC a Source #

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

Methods

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

xC :: Either d x Source #

parseC :: (DC d, CharParsing p) => p d Source #

>>> parse (parseC <* eof) "test" "C" :: Either ParseError (DigitC ())
Right (DigitC ())
>>> parse parseC "test" "Cxyz" :: Either ParseError (DigitC ())
Right (DigitC ())
>>> isn't _Right (parse parseC "test" "xyz" :: Either ParseError (DigitC ()))
True
\c -> c /= 'C' ==> isn't _Right (parse parseC "test" [c] :: Either ParseError (DigitC ()))