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 ()))