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)