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

Methods

dF :: Prism' Digit () Source #

xF :: Digit Source #

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

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