digit-0.4.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 a => Dc (Digitc a) Source # 

Methods

dc :: Prism' (Digitc a) () Source #

xc :: Digitc a Source #

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

Methods

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

xc :: Either d x Source #

parsec :: (Dc d, CharParsing p) => p d Source #

>>> parse (parsec <* eof) "test" "c" :: Either ParseError (Digitc ())
Right (Digitc ())
>>> parse parsec "test" "cxyz" :: Either ParseError (Digitc ())
Right (Digitc ())
>>> isn't _Right (parse parsec "test" "xyz" :: Either ParseError (Digitc ()))
True
\c -> c /= 'c' ==> isn't _Right (parse parsec "test" [c] :: Either ParseError (Digitc ()))