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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DE

Synopsis

Documentation

class DE d where Source #

Minimal complete definition

dE

Methods

dE :: Prism' d () Source #

xE :: d Source #

Instances

DE () Source # 

Methods

dE :: Prism' () () Source #

xE :: () Source #

DE a => DE (DigitE a) Source # 

Methods

dE :: Prism' (DigitE a) () Source #

xE :: DigitE a Source #

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

Methods

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

xE :: Either d x Source #

parseE :: (DE d, CharParsing p) => p d Source #

>>> parse (parseE <* eof) "test" "E" :: Either ParseError (DigitE ())
Right (DigitE ())
>>> parse parseE "test" "Exyz" :: Either ParseError (DigitE ())
Right (DigitE ())
>>> isn't _Right (parse parseE "test" "xyz" :: Either ParseError (DigitE ()))
True
\c -> c /= 'E' ==> isn't _Right (parse parseE "test" [c] :: Either ParseError (DigitE ()))