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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.DF

Synopsis

Documentation

class DF d where Source #

Minimal complete definition

dF

Methods

dF :: Prism' d () Source #

xF :: d Source #

Instances

DF () Source # 

Methods

dF :: Prism' () () Source #

xF :: () Source #

DF a => DF (DigitF a) Source # 

Methods

dF :: Prism' (DigitF a) () Source #

xF :: DigitF a Source #

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

Methods

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

xF :: Either d x Source #

parseF :: (DF d, CharParsing p) => p d Source #

>>> parse (parseF <* eof) "test" "F" :: Either ParseError (DigitF ())
Right (DigitF ())
>>> parse parseF "test" "Fxyz" :: Either ParseError (DigitF ())
Right (DigitF ())
>>> isn't _Right (parse parseF "test" "xyz" :: Either ParseError (DigitF ()))
True
\c -> c /= 'F' ==> isn't _Right (parse parseF "test" [c] :: Either ParseError (DigitF ()))