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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.Da

Synopsis

Documentation

class Da d where Source #

Minimal complete definition

da

Methods

da :: Prism' d () Source #

xa :: d Source #

Instances

Da () Source # 

Methods

da :: Prism' () () Source #

xa :: () Source #

Da Digit Source # 

Methods

da :: Prism' Digit () Source #

xa :: Digit Source #

parsea :: (Da d, CharParsing p) => p d Source #

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