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

Methods

dD :: Prism' Digit () Source #

xD :: Digit Source #

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

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