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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D7

Synopsis

Documentation

class D7 d where Source #

Minimal complete definition

d7

Methods

d7 :: Prism' d () Source #

x7 :: d Source #

Instances

D7 () Source # 

Methods

d7 :: Prism' () () Source #

x7 :: () Source #

D7 a => D7 (Digit7 a) Source # 

Methods

d7 :: Prism' (Digit7 a) () Source #

x7 :: Digit7 a Source #

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

Methods

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

x7 :: Either d x Source #

parse7 :: (D7 d, CharParsing p) => p d Source #

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