digit-0.5.2: 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)