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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.Dc

Synopsis

Documentation

class Dc d where Source #

Minimal complete definition

dc

Methods

dc :: Prism' d () Source #

xc :: d Source #

Instances

Dc () Source # 

Methods

dc :: Prism' () () Source #

xc :: () Source #

Dc Digit Source # 

Methods

dc :: Prism' Digit () Source #

xc :: Digit Source #

parsec :: (Dc d, CharParsing p) => p d Source #

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