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

Methods

dB :: Prism' Digit () Source #

xB :: Digit Source #

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

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