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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D9

Synopsis

Documentation

class D9 d where Source #

Minimal complete definition

d9

Methods

d9 :: Prism' d () Source #

x9 :: d Source #

Instances

D9 () Source # 

Methods

d9 :: Prism' () () Source #

x9 :: () Source #

D9 a => D9 (Digit9 a) Source # 

Methods

d9 :: Prism' (Digit9 a) () Source #

x9 :: Digit9 a Source #

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

Methods

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

x9 :: Either d x Source #

parse9 :: (D9 d, CharParsing p) => p d Source #

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