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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DD

Synopsis

Documentation

class DD d where Source #

Minimal complete definition

dD

Methods

dD :: Prism' d () Source #

xD :: d Source #

Instances

DD () Source # 

Methods

dD :: Prism' () () Source #

xD :: () Source #

DD a => DD (DigitD a) Source # 

Methods

dD :: Prism' (DigitD a) () Source #

xD :: DigitD a Source #

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

Methods

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

xD :: Either d x Source #

parseD :: (DD d, CharParsing p) => p d Source #

>>> parse (parseD <* eof) "test" "D" :: Either ParseError (DigitD ())
Right (DigitD ())
>>> parse parseD "test" "Dxyz" :: Either ParseError (DigitD ())
Right (DigitD ())
>>> isn't _Right (parse parseD "test" "xyz" :: Either ParseError (DigitD ()))
True
\c -> c /= 'D' ==> isn't _Right (parse parseD "test" [c] :: Either ParseError (DigitD ()))