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)