digit-0.5.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 Digit Source # 

Methods

dC :: Prism' Digit () Source #

xC :: Digit Source #

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

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