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)