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 ()))