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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DB

Synopsis

Documentation

class DB d where Source #

Minimal complete definition

dB

Methods

dB :: Prism' d () Source #

xB :: d Source #

Instances

DB () Source # 

Methods

dB :: Prism' () () Source #

xB :: () Source #

DB a => DB (DigitB a) Source # 

Methods

dB :: Prism' (DigitB a) () Source #

xB :: DigitB a Source #

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

Methods

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

xB :: Either d x Source #

parseB :: (DB d, CharParsing p) => p d Source #

>>> parse (parseB <* eof) "test" "B" :: Either ParseError (DigitB ())
Right (DigitB ())
>>> parse parseB "test" "Bxyz" :: Either ParseError (DigitB ())
Right (DigitB ())
>>> isn't _Right (parse parseB "test" "xyz" :: Either ParseError (DigitB ()))
True
\c -> c /= 'B' ==> isn't _Right (parse parseB "test" [c] :: Either ParseError (DigitB ()))