digit-0.5.2: 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 Digit Source # 

Methods

d7 :: Prism' Digit () Source #

x7 :: Digit Source #

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

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