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

Safe HaskellNone
LanguageHaskell2010

Data.Digit.D5

Synopsis

Documentation

class D5 d where Source #

Minimal complete definition

d5

Methods

d5 :: Prism' d () Source #

x5 :: d Source #

Instances

D5 () Source # 

Methods

d5 :: Prism' () () Source #

x5 :: () Source #

D5 a => D5 (Digit5 a) Source # 

Methods

d5 :: Prism' (Digit5 a) () Source #

x5 :: Digit5 a Source #

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

Methods

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

x5 :: Either d x Source #

parse5 :: (D5 d, CharParsing p) => p d Source #

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