digit-0.5.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 Digit Source # 

Methods

d9 :: Prism' Digit () Source #

x9 :: Digit Source #

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

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