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