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

Methods

dE :: Prism' Digit () Source #

xE :: Digit Source #

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

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